http://hdl.handle.net/1926/224 )
_______________________________________________ Insight-users mailing list Insight-users@... http://www.itk.org/mailman/listinfo/insight-users
_______________________________________________ Insight-users mailing list Insight-users@... http://www.itk.org/mailman/listinfo/insight-users
_______________________________________________ Insight-users mailing list Insight-users@... http://www.itk.org/mailman/listinfo/insight-users
Hi,
I’ve tried to use the filter itk::OrientImageFilter. I’ve read a several documentation about DICOM orientation standards, tried some source code examples and read several emails in the mailing list without success… . My main goal is to be able to transform the DICOM volume image that can be in any DICOM orientation (LPS, RAS, RAI, LPI, …) to an itk Volume image always oriented in the same way (for example LPS).
I’ve tried this code:
typedef itk::OrientedImage<dcmAPI::PixelType, 3> OrientedVolumeType;
typedef itk::ImageSeriesReader< OrientedVolumeType > VolumeReader;
VolumeReader::Pointer volumeReader = VolumeReader::New();
itk::GDCMImageIO::Pointer dicomIO = itk::GDCMImageIO::New();
volumeReader->SetImageIO( dicomIO );
volumeReader->SetFileNames( sliceFilePaths );
volumeReader->Update();
OrientedVolumeType::Pointer volume = volumeReader->GetOutput();
itk::OrientImageFilter<VolumeType,VolumeType>::Pointer orienter = itk::OrientImageFilter<VolumeType,VolumeType>::New();
orienter->UseImageDirectionOn();
orienter->SetDesiredCoordinateOrientation( itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_LPS);
orienter->SetInput(volume);
orienter->Update();
It works fine with RAI input image orientation. However, it doesn’t work for RSA input image orientation because the output image is not in LPS orientation. I’ve used VolView to check that the input images are correct and it works fine: the VTK output image is always in the same orientation.
I’ve also debugged a little bit with DICOM RSA input orientation. The itk::OrientImageFilter does this steps:
1. RSA -> RAS. Permute Y And Z axis
2. RAS -> LAS. Flip X axis
3. LAS -> LPS. Flip Y axis
However the output is not correct. It seems that when input image is permuted (Y and Z axis), the orientation of the third axis is also indirectly flipped (X). So after the permute filter, the image orientation is not RAS, as it was expected by the filter.
I was thinking to create a table for permutation and flipping parameters depending on each orientation. However I don’t have sample DICOM data for all the possible orientations.
Has anybody tried this filter? Has anybody tried RSA orientation input image? Do you know what input image orientations have been tried?
Thanks!
Xavi
_______________________________________________ Insight-users mailing list Insight-users@... http://www.itk.org/mailman/listinfo/insight-users
I think the OrientImageFIlter's letter notation is the opposite of the DICOM orientations. Instead of LPS, try RAI. Bill On Mon, Feb 2, 2009 at 10:01 AM, Xavier Planes <xplanes@...> wrote: > Hi, > > > > I've tried to use the filter itk::OrientImageFilter. I've > read a several documentation about DICOM orientation standards, tried some > source code examples and read several emails in the mailing list without > success… . My main goal is to be able to transform the DICOM volume image > that can be in any DICOM orientation (LPS, RAS, RAI, LPI, …) to an itk > Volume image always oriented in the same way (for example LPS). > > > > I've tried this code: > > > > typedef itk::OrientedImage<dcmAPI::PixelType, 3> > OrientedVolumeType; > > typedef itk::ImageSeriesReader< OrientedVolumeType > > VolumeReader; > > > > VolumeReader::Pointer volumeReader = VolumeReader::New(); > > itk::GDCMImageIO::Pointer dicomIO = itk::GDCMImageIO::New(); > > volumeReader->SetImageIO( dicomIO ); > > volumeReader->SetFileNames( sliceFilePaths ); > > volumeReader->Update(); > > OrientedVolumeType::Pointer volume = > volumeReader->GetOutput(); > > > > itk::OrientImageFilter<VolumeType,VolumeType>::Pointer orienter = > itk::OrientImageFilter<VolumeType,VolumeType>::New(); > > orienter->UseImageDirectionOn(); > > orienter->SetDesiredCoordinateOrientation( > itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_LPS); > > orienter->SetInput(volume); > > orienter->Update(); > > > > It works fine with RAI input image orientation. However, it > doesn't work for RSA input image orientation because the output image is not > in LPS orientation. I've used VolView to check that the input images are > correct and it works fine: the VTK output image is always in the same > orientation. > > > > I've also debugged a little bit with DICOM RSA input orientation. The > itk::OrientImageFilter does this steps: > > 1. RSA -> RAS. Permute Y And Z axis > > 2. RAS -> LAS. Flip X axis > > 3. LAS -> LPS. Flip Y axis > > However the output is not correct. It seems that when input image is > permuted (Y and Z axis), the orientation of the third axis is also > indirectly flipped (X). So after the permute filter, the image orientation > is not RAS, as it was expected by the filter. > > > > I was thinking to create a table for permutation and flipping parameters > depending on each orientation. However I don't have sample DICOM data for > all the possible orientations. > > > > Has anybody tried this filter? Has anybody tried RSA orientation input > image? Do you know what input image orientations have been tried? > > > > Thanks! > > Xavi > > _______________________________________________ > Insight-users mailing list > Insight-users@... > http://www.itk.org/mailman/listinfo/insight-users > >
|
Hi all, I am faced with a problem regarding the pasting or stitching of oblique images in a final volume. For instance, suppose I have three images, each one oriented at Rx=[-5, 0, +5] degrees, how could I read these oriented images and place all three in a common volume? I am not certain that the OrientImageFilter can do these, even though it can allow us to use the following command: orienter --> SetUseImageDirection( ); any insight on this would be appreciated. Pascal --- On Mon, 2/2/09, Bill Lorensen <bill.lorensen <at> gmail.com> wrote: From: Bill Lorensen <bill.lorensen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> |
_______________________________________________ Insight-users mailing list Insight-users@... http://www.itk.org/mailman/listinfo/insight-users
Thanks Bill, I've read that itk orientation names are the opposite of DICOM orientation names. The real input image orientations I've tried are LPS (itk is RAI) and LIP (itk is RSA) and the real output image orientation I would like to get is RAI (itk is LPS). However, I think the problem is not in the output orientation I set to the filter because for the two input DICOM images I've tried, the output image had different orientation between them. (sorry, in my first email ALL orientation names are in itk orientation letter notation). -----Original Message----- From: Bill Lorensen [mailto:bill.lorensen@...] Sent: lunes, 02 de febrero de 2009 16:27 To: Xavier Planes Cc: insight-users@... Subject: Re: [Insight-users] itk::OrientImageFilter I think the OrientImageFIlter's letter notation is the opposite of the DICOM orientations. Instead of LPS, try RAI. Bill On Mon, Feb 2, 2009 at 10:01 AM, Xavier Planes <xplanes@...> wrote: > Hi, > > > > I've tried to use the filter itk::OrientImageFilter. I've > read a several documentation about DICOM orientation standards, tried some > source code examples and read several emails in the mailing list without > success... . My main goal is to be able to transform the DICOM volume image > that can be in any DICOM orientation (LPS, RAS, RAI, LPI, ...) to an itk > Volume image always oriented in the same way (for example LPS). > > > > I've tried this code: > > > > typedef itk::OrientedImage<dcmAPI::PixelType, 3> > OrientedVolumeType; > > typedef itk::ImageSeriesReader< OrientedVolumeType > > VolumeReader; > > > > VolumeReader::Pointer volumeReader = VolumeReader::New(); > > itk::GDCMImageIO::Pointer dicomIO = itk::GDCMImageIO::New(); > > volumeReader->SetImageIO( dicomIO ); > > volumeReader->SetFileNames( sliceFilePaths ); > > volumeReader->Update(); > > OrientedVolumeType::Pointer volume = > volumeReader->GetOutput(); > > > > itk::OrientImageFilter<VolumeType,VolumeType>::Pointer orienter = > itk::OrientImageFilter<VolumeType,VolumeType>::New(); > > orienter->UseImageDirectionOn(); > > orienter->SetDesiredCoordinateOrientation( > itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_LPS); > > orienter->SetInput(volume); > > orienter->Update(); > > > > It works fine with RAI input image orientation. However, it > doesn't work for RSA input image orientation because the output image is not > in LPS orientation. I've used VolView to check that the input images are > correct and it works fine: the VTK output image is always in the same > orientation. > > > > I've also debugged a little bit with DICOM RSA input orientation. The > itk::OrientImageFilter does this steps: > > 1. RSA -> RAS. Permute Y And Z axis > > 2. RAS -> LAS. Flip X axis > > 3. LAS -> LPS. Flip Y axis > > However the output is not correct. It seems that when input image is > permuted (Y and Z axis), the orientation of the third axis is also > indirectly flipped (X). So after the permute filter, the image orientation > is not RAS, as it was expected by the filter. > > > > I was thinking to create a table for permutation and flipping parameters > depending on each orientation. However I don't have sample DICOM data for > all the possible orientations. > > > > Has anybody tried this filter? Has anybody tried RSA orientation input > image? Do you know what input image orientations have been tried? > > > > Thanks! > > Xavi > > _______________________________________________ > Insight-users mailing list > Insight-users@... > http://www.itk.org/mailman/listinfo/insight-users > > No virus found in this incoming message. Checked by AVG - http://www.avg.com Version: 8.0.233 / Virus Database: 270.10.10/1903 - Release Date: 2/1/2009 6:02 PM
Hi John,
Yes, copying the files is still the simplest way to proceed.
Note that you may find useful also:
vtkKWImage.cxx
vtkKWImage.h
vtkKWImageIO.cxx
vtkKWImageIO.h
These are the classes described in the Insight Journal paper:
http://hdl.handle.net/1926/495
http://www.insight-journal.org/browse/publication/146
Regards,
Luis
-----------------------
John Drescher wrote:
> Is the copying of the headers to your application still the
> recommended method of combining ITK and VTK in applications?
>
> itkImageToVTKImageFilter.h
> itkImageToVTKImageFilter.txx
> itkVTKImageToImageFilter.h
> itkVTKImageToImageFilter.txx
>
> http://www.itk.org/Wiki/ITK_FAQ#How_to_combine_ITK_and_VTK_in_my_application
>
> I tried to enable the USE_WRAP_ITK and ITK_USE_REVIEW but this takes a
> really long time to build (on windows) and fails to build on gentoo
> linux. It's seems like I really should take the advice of the wiki.
>
> --
> John M. Drescher
> _______________________________________________
> Insight-users mailing list
> Insight-users@...
> http://www.itk.org/mailman/listinfo/insight-users
>
HI Greg,
You will find examples on the use of the LinearInterpolator at:
Insight/Examples/Filtering
ResampleImageFilter4.cxx
ResampleImageFilter5.cxx
ResampleImageFilter6.cxx
ResampleImageFilter9.cxx
ResampleVolumesToBeIsotropic.cxx
SubsampleVolume.cxx
They are all described in detail in the ITK Software Guide
http://www.itk.org/ItkSoftwareGuide.pdf
Please note that the Linear interpolator, when instantiated
on 3D images will perform tri-linear interpolation.
Regards,
Luis
-------------------
Greg Fokum wrote:
> Greetings
>
> I would like to know that the solution to do 3D trilinear interpolation
> in itk is.
> I have some 3D data ,actually a 3D grid of dimensions NX NY and NZ each
> x,y,z point in the grid is associated with a scalar float value. I want
> to get an arbitray xi,yi,zi point and interoplate into my 3D data. Can
> someone show me a filter pipeline for doing this ?
>
> Thanks in advance
>
> GT
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@...
> http://www.itk.org/mailman/listinfo/insight-users
Hi Han,
Your code looks good, except for the fact that you
are computing the displacement backwards
Instead of:
displacement = fixedPoint -movingPoint;
You should do:
displacement = movingPoint -fixedPoint;
This is clearer if you look at the source code
of the WarpImageFilter, to see how the displacement
is going to be used during resampling:
Insight/Code/BasicFilters/itkWarpImageFilter.txx
lines 202-231:
while( !outputIt.IsAtEnd() )
{
// get the output image index
index = outputIt.GetIndex();
outputPtr->TransformIndexToPhysicalPoint( index, point );
// get the required displacement
displacement = fieldIt.Get();
// compute the required input image point
for(unsigned int j = 0; j < ImageDimension; j++ )
{
point[j] += displacement[j];
}
// get the interpolated value
if( m_Interpolator->IsInsideBuffer( point ) )
{
PixelType value = static_cast<PixelType>(
m_Interpolator->Evaluate( point ) );
outputIt.Set( value );
}
else
{
outputIt.Set( m_EdgePaddingValue );
}
++outputIt;
++fieldIt;
progress.CompletedPixel();
}
Regards,
Luis
----------------
Han D. F wrote:
> I use the bspline deform field (which is computed from the bapline
> registration algorithm) to wrap the image to the new image.
> When I use the the bspline parameters, the result is ok.
> when using the defor field, the result is wrong.
> Below is the code, id there is some thing wrong?
> thnanks
>
> assuming the bsplineTransform is computed and I will compute the deform
> field and warp to a new image.
> help me check the code and many thanks to your help
>
> // define the types for computing deform field
> typedef itk::Point< float, ImageDimension > PointType;
> typedef itk::Vector< float, ImageDimension > VectorType;
> typedef itk::Image< VectorType, ImageDimension > DeformationFieldType;
> DeformationFieldType::Pointer field = DeformationFieldType::New();
> field->SetRegions( fixedRegion );
> field->SetOrigin( fixedOrigin );
> field->SetSpacing( fixedSpacing );
> field->SetDirection( fixedDirection );
> field->Allocate();
> typedef itk::ImageRegionIterator< DeformationFieldType > FieldIterator;
> FieldIterator fi( field, fixedRegion );
> fi.GoToBegin();
> TransformType::InputPointType fixedPoint;
> TransformType::OutputPointType movingPoint;
> DeformationFieldType::IndexType index;
> VectorType displacement;
> // getting the deform field, I have see the result the computed
> displacement is right
> while( ! fi.IsAtEnd() )
> {
> index = fi.GetIndex();
> field->TransformIndexToPhysicalPoint( index, fixedPoint );
> movingPoint = bsplineTransform->TransformPoint( fixedPoint );
> displacement = fixedPoint -movingPoint ;
> fi.Set( displacement );
> //std::cout<<displacement<<std::endl;
> ++fi;
>
> }
>
> typedef itk::WarpImageFilter< FixedImageType,
> FixedImageType,
> DeformationFieldType > DeformFilterType;
> DeformFilterType::Pointer filter = DeformFilterType::New();
> // fiil the deform filter,such as SetInterpolator,SetOutputSpacing,....
>
> typedef itk::LinearInterpolateImageFunction<
> FixedImageType, double > InterpolatorType1;
> InterpolatorType1::Pointer interpolator1 = InterpolatorType1::New();
> filter->SetInterpolator( interpolator1 );
> filter->SetOutputSpacing( field->GetSpacing() );
> filter->SetOutputOrigin( field->GetOrigin() );
> filter->SetDeformationField( field );
> filter->SetInput( fixedReader->GetOutput() );
>
> //define the writer
>
> typedef itk::ImageFileWriter< FixedImageType > WriterType;
> WriterType::Pointer writer = WriterType::New();
> writer->SetFileName( argv[5] );
> writer->SetInput( filter->GetOutput() );
> // try the wrap filter and get the result
> try
> {
> writer->Update();
> }
> catch( itk::ExceptionObject & excp )
> {
> std::cerr << "Exception thrown " << std::endl;
> std::cerr << excp << std::endl;
> }
>
>
>
>
>
> ------------------------------------------------------------------------
> Ãâ·ÑËÍÄãºÍ°®ÈËÈ¥ÐÂ¼ÓÆÂ¹ýÇéÈ˽ڣ¡
> <http://love.mail.163.com/valentine/main.do>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@...
> http://www.itk.org/mailman/listinfo/insight-users
_______________________________________________ Insight-users mailing list Insight-users@... http://www.itk.org/mailman/listinfo/insight-users
Hi Shoosh,
The source code of the ImageViewer is available in
the InsightApplications module, under the directory
InsightApplications/ImageViewer
Instructions on how to download ImageApplications
are available at:
http://www.itk.org/ITK/resources/software.html
(for CVS instructions, please look at the bottom
of that page).
For other image viewers,
You may want to try:
a) Slicer www.slicer.org
b) VV
http://www.midasjournal.org/browse/publication/288
c) and of course SNAP
Regards,
Luis
---------------------
shoosh moosh wrote:
> Hi,
> I need an application to help me view images in ITK. I think Image
> Viewer can be used, but I can't find the source for it. Where can I
> download it from?
> Also, can Image Viewer be used to view dicom volumes? If not, what
> should I use? SNAP?
> Thanks,
>
> ------------------------------------------------------------------------
> Get news, entertainment and everything you care about at Live.com. Check
> it out! <http://www.live.com/getstarted.aspx >
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@...
> http://www.itk.org/mailman/listinfo/insight-users
RSS Feed92 | |
|---|---|
287 | |
268 | |
176 | |
204 | |
204 | |
207 | |
296 | |
317 | |
293 | |
208 | |
258 | |
286 | |
339 | |
293 | |
314 | |
333 | |
278 | |
235 | |
238 | |
217 | |
248 | |
246 | |
352 | |
426 | |
484 | |
394 | |
485 | |
428 | |
198 | |
417 | |
291 | |
326 | |
279 | |
291 | |
247 | |
291 | |
496 | |
503 | |
561 | |
426 | |
360 | |
416 | |
777 | |
652 | |
463 | |
519 | |
615 | |
549 | |
461 | |
379 | |
483 | |
442 | |
314 | |
388 | |
308 | |
351 | |
280 | |
206 | |
444 | |
378 | |
463 | |
435 | |
252 | |
245 | |
188 | |
192 | |
315 | |
298 | |
298 | |
318 | |
378 | |
340 | |
355 | |
362 | |
490 | |
378 | |
354 | |
193 | |
293 | |
360 | |
327 | |
439 | |
360 | |
399 | |
468 | |
341 | |
372 | |
404 | |
334 | |
387 | |
327 | |
384 | |
452 | |
386 | |
404 | |
414 | |
482 | |
414 | |
405 | |
270 | |
264 | |
333 | |
363 | |
337 | |
302 | |
482 | |
597 | |
441 | |
462 | |
624 | |
597 | |
237 | |
1 |