[vtkusers] how to change from one slice to another
Sercani
sercanimailgroups at gmail.com
Tue Jul 7 02:17:36 EDT 2009
check this example which in vtk's example directory:
VTK\Examples\ImageProcessing\Cxx\ImageSlicing.cxx .This example shows
how to slice between different projections(axial, sagittal, coronal).
Write your code just like that and write an observer for
mouseWheelMoved function and add this part:
double sliceSpacing = spacing[whichProjection]; //axial=2,
sagittal =0, coronal=1 depends on which projection you show on panel...
double point[] = new double[4];
point[0] = 0.0;
point[1] = 0.0;
point[2] = sliceSpacing * motions; //motions = backward=-1,
forward=1
point[3] = 1.0;
double cent[] = new double[4];
matrix.MultiplyPoint(point, cent);
matrix.SetElement(0, 3, cent[0]);
matrix.SetElement(1, 3, cent[1]);
matrix.SetElement(2, 3, cent[2]);
And remember to keep the discussion on vtk user list :D
Regards
Sercani...
Lic. José M. Rodriguez Bacallao wrote:
> I'm not using ImageViewer2, so I have to do it my self. With respect
> to vtkImageReslice, how to use it to change from one slice to another
> in the same plane?
>
> On 7/6/09, Sercani <sercanimailgroups at gmail.com> wrote:
>
>> Hi Rodriguez;
>> Check out http://www.vtk.org/doc/nightly/html/classvtkImageViewer2.html
>> this documentation...This class has a function named SetSlice(int s) for
>> reslicing issues...Or you can use vtkImageReslice with transformation
>> matrixes for reslicing...
>> Regards
>> Sercani...
>>
>> Lic. José M. Rodriguez Bacallao wrote:
>>
>>> hi folks, I have an ImageDara loaded with all DICOM images from a
>>> scan, dimensions are: 512, 512, 30, now I can display the first image
>>> just fine but I would like to change from one image (slice) to another
>>> and display it, how to make this happen?
>>>
>>>
>>>
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090707/6b5a16b6/attachment.htm>
More information about the vtkusers
mailing list