Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, October 9, 2012 1:01:32 AM(UTC)

kb7  
kb7

Groups: Registered
Posts: 71


Hello,

I want to rotate the image in medicalviewer by some angle ( e.g by 5 degree ) other than 90,180,270. How can i do this using Dotnet class and leadtools version 17.

Thanks.....
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, October 9, 2012 5:24:04 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


Obtain the RasterImage from the medical viewer's cells[Index]. After that, use our RotateCommand class on the image to rotate it, then assign the modified image back to the medical viewer.
The code looks like this:
===========================
RasterImage img;
img = ((MedicalViewerCell)_medicalViewer.Cells[0]).Image;
RotateCommand rotate = new RotateCommand();
rotate.Angle = 500;
rotate.Flags = RotateCommandFlags.Resample;
rotate.Run(img);
((MedicalViewerCell)_medicalViewer.Cells[0]).Image = img;
_medicalViewer.Refresh();
===========================

 
#3 Posted : Tuesday, October 9, 2012 10:01:24 PM(UTC)

kb7  
kb7

Groups: Registered
Posts: 71


Thanks for the reply...

I tried this but it only change the angle of only one frame not all the frames of the image (XA or RF modality image). How can i convert the all the frames using this command..



 
#4 Posted : Tuesday, October 9, 2012 10:02:49 PM(UTC)

kb7  
kb7

Groups: Registered
Posts: 71


or can u provide some sample application to do this.
 
#5 Posted : Wednesday, October 10, 2012 12:22:50 AM(UTC)

Daoud  
Daoud

Groups: Registered
Posts: 256


You have to apply the rotate command on each page. You can do that using a for loop like the following:
================
RasterImage img;
img = ((MedicalViewerCell)_medicalViewer.Cells[0]).Image;
RotateCommand rotate = new RotateCommand();
rotate.Angle = 500;
rotate.Flags = RotateCommandFlags.Resample;
for (int i = 1; i <= img.PageCount; i++)
{
   img.Page=i;
   rotate.Run(img);
}
img.Page = 1;
((MedicalViewerCell)_medicalViewer.Cells[0]).Image = img;
_medicalViewer.Refresh();
================
Note: For the rotation flags, you should use the one that best suits your requirements. For more information, please refer to our documentation.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.053 seconds.