[Insight-developers] Hi all I writing an ITK Filter with different input output dimension

Matt McCormick matt.mccormick at kitware.com
Thu Jul 28 12:37:07 EDT 2011


Thanks, Hao.

You will need to write your own GenerateOutputInformation.  In this method,
it needs to be decided what should be the spacing, origin, size, etc. in the
third dimension of the output image.

For an example of a filter that changes dimensions, please see
ExtractImageFilter.

Thanks,
Matt

On Thu, Jul 28, 2011 at 11:36 AM, Matt McCormick <matt.mccormick at kitware.com
> wrote:

> Hi Hao,
>
> Please include the code for your filter.
>
> Thanks,
> Matt
>
> On Thu, Jul 28, 2011 at 11:18 AM, 丁昊 <tin.dinghao at gmail.com> wrote:
>
>> Hi
>>
>> My input image is a 2D image and the output is need to be a 3D image.
>> I inherited the imagetoimagefilter as the base class.
>>
>> But when I test the filter it gives me :
>>
>> terminate called after throwing an instance of 'itk::ExceptionObject'
>>   what():  /usr/local/include/InsightToolkit/Common/itkImageBase.txx:341:
>> itk::ERROR: Image(0x1007af620): itk::ImageBase::CopyInformation() cannot
>> cast PKN3itk10DataObjectE to PKN3itk9ImageBaseILj3EEE
>> Abort trap
>>
>> could any one help me out ~
>>
>> Hao
>>
>> _______________________________________________
>> 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://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-developers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110728/aa8806c4/attachment.htm>


More information about the Insight-developers mailing list