[Insight-users] Casting 3D to 2D Images with CastImageFilter Results in Error

Lars Friedrich Lars lars-friedrich at gmx.net
Thu Jun 10 16:57:55 EDT 2010


Hi,

recently we had a discussion concerning - more or less - the same topic:

http://itk-insight-users.2283740.n2.nabble.com/CastImageFilter-BUG-tt4921017.html#none

regards,

lars



-------- Original-Nachricht --------
> Datum: Thu, 10 Jun 2010 16:47:53 +0100
> Von: Constantine Zakkaroff <mnkz at leeds.ac.uk>
> An: "insight-users at itk.org" <insight-users at itk.org>
> Betreff: [Insight-users] Casting 3D to 2D Images with CastImageFilter	Results in Error

> Yello ALL.
> 
> The description for CastImageFilter says this:
> 
> CastImageFilter allows the input and output image to be different 
> dimensions. This is useful if you want to cast an 2D image to 3D image. 
> The resulting 3D image will have a single slice. If you attempt to cast 
> an image to a lower dimension, the first "slice" (or line or volume) 
> will be extracted. If you want to convert an image to a lower dimension 
> and specify the subspace (i.e. which slice of a volume, etc.) then you 
> should use ExtractImageFilter.
> 
> While it is a slightly odd thing to do, I thought it can be used as a 
> shortcut to turn M*N*1-sized 3D images into M*N-sized 2D images.
> 
> This code
> 
> typedef itk::Image<USHORT, 3> Image2DType;
> typedef itk::OrientedImage<USHORT, 3> Image3DType;
> 
> typedef itk::CastImageFilter<Image3DType, Image2DType>
> Cast3DTo2DFilterType;
> Cast3DTo2DFilterType::Pointer cast3DTo2DFilter = 
> Cast3DTo2DFilterType::New();
> cast3DTo2DFilter->SetInput(reformattedAngioSlice);
> cast3DTo2DFilter->Update();
> 
> results in error in 
> UnaryFunctorImageFilter<TInputImage,TOutputImage,TFunction>
> ::GenerateOutputInformation(), when the output and input directions are 
> compared. Method's code runs past the end of the output direction matrix.
> 
> ... unless I'm doing something wrong with the filter.
> 
> Can anyone please clarify/confirm this issue?
> 
> Regards,
> Constantine
> 
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
> 
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users

-- 
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl


More information about the Insight-users mailing list