[ITK] itk::N4BiasFieldCorrectionImageFilter ; Inputs do not occupy the same physical space

Matt McCormick matt.mccormick at kitware.com
Tue Sep 22 10:40:29 EDT 2015


Hi Peter,

Maybe the origin is getting changed in the pipeline update after the
debugger output was created?  The error indicates the origins are
different:

  InputImage Origin: [8.7000000e+01, 1.2300000e+02, -1.6400000e+02],
InputImage_1 Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00]

HTH,
Matt

On Thu, Sep 17, 2015 at 3:36 AM, P. Pieperhoff
<p.pieperhoff at fz-juelich.de> wrote:
> Dear ITK-Users,
>
> I want to use the bias field correction filter
> itk::N4BiasFieldCorrectionImageFilter with a mask, that indicates the voxels
> where the intensities shall be corrected.
>
> I have attached the code of my filter implementation. The program is called
> as
>
> N4_test inputimage.nii mask.nii output.nii
>
>
> However, the program crashes with the following error message:
>
>>>>>>
> terminate called after throwing an instance of 'itk::ExceptionObject'
>   what():
> /develop/ITK/ITK-4.8.0/InsightToolkit-4.8.0/Modules/Core/Common/include/itkImageToImageFilter.hxx:248:
> itk::ERROR: N4BiasFieldCorrectionImageFilter(0x299f3d0): Inputs do not
> occupy the same physical space!
> InputImage Origin: [8.7000000e+01, 1.2300000e+02, -1.6400000e+02],
> InputImage_1 Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00]
>         Tolerance: 1.0000000e-06
> InputImage Direction: -1.0000000e+00 0.0000000e+00 0.0000000e+00
> 0.0000000e+00 -1.0000000e+00 0.0000000e+00
> 0.0000000e+00 0.0000000e+00 1.0000000e+00
> , InputImage_1 Direction: 1.0000000e+00 0.0000000e+00 0.0000000e+00
> 0.0000000e+00 1.0000000e+00 0.0000000e+00
> 0.0000000e+00 0.0000000e+00 1.0000000e+00
>
>         Tolerance: 1.0000000e-06
>
> Aborted
>
>
> <<<<<<
>
>
> But the sizes, origins and the direction matrices of the input image and
> mask are definitively identical.
> Below is the debug information of the input and mask image, before the
> program crashes.
>
>
> I'm using ITK version 4.8.0 on Debian-Linux.
>
> Please could anyone help me to get the program running?
> Thanks a lot in advance!
>
> Peter
>
>
>
>
> (gdb) p *pInputImage
> $82 = {<itk::ImageBase<3u>> = {<itk::DataObject> = {<itk::Object> =
> {<itk::LightObject> = {_vptr.LightObject = 0xeaa810 <vtable for
> itk::Image<float, 3u>+16>, m_ReferenceCount = {m_Object = 1}}, m_Debug =
> false, m_MTime = {m_ModifiedTime = 196}, static m_GlobalWarningDisplay =
> true, m_SubjectImplementation = 0x0, m_MetaDataDictionary = 0x19fbc80,
> m_ObjectName = ""}, m_Source = {m_Pointer = 0x19f0dd0}, m_SourceOutputName =
> "Primary", m_UpdateMTime = {m_ModifiedTime = 197}, m_RealTimeStamp =
> {m_Seconds = 0, m_MicroSeconds = 0}, m_ReleaseDataFlag = false,
> m_DataReleased = false, m_PipelineMTime = 52, static m_GlobalReleaseDataFlag
> = false}, m_Spacing = {<itk::FixedArray<double, 3u>> = {m_InternalArray =
> {1, 1, 1}}, <No data fields>}, m_Origin = {<itk::FixedArray<double, 3u>> =
> {m_InternalArray = {87, 123, -164}}, <No data fields>}, m_Direction =
> {m_Matrix = {data_ = {{-1, 0, 0}, {0, -1, 0}, {0, 0, 1}}}},
> m_InverseDirection = {m_Matrix = {data_ = {{-1, 0, 0}, {0, -1, 0}, {0, 0,
> 1}}}}, m_IndexToPhysicalPoint = {m_Matrix = {data_ = {{-1, 0, 0}, {0, -1,
> 0}, {0, 0, 1}}}}, m_PhysicalPointToIndex = {m_Matrix = {data_ = {{-1, 0, 0},
> {0, -1, 0}, {0, 0, 1}}}}, m_OffsetTable = {1, 176, 40832, 10452992},
> m_LargestPossibleRegion = {<itk::Region> = {_vptr.Region = 0xeaad90 <vtable
> for itk::ImageRegion<3u>+16>}, m_Index = {m_Index = {0, 0, 0}}, m_Size =
> {m_Size = {176, 232, 256}}}, m_RequestedRegion = {<itk::Region> =
> {_vptr.Region = 0xeaad90 <vtable for itk::ImageRegion<3u>+16>}, m_Index =
> {m_Index = {0, 0, 0}}, m_Size = {m_Size = {176, 232, 256}}},
> m_BufferedRegion = {<itk::Region> = {_vptr.Region = 0xeaad90 <vtable for
> itk::ImageRegion<3u>+16>}, m_Index = {m_Index = {0, 0, 0}}, m_Size = {m_Size
> = {176, 232, 256}}}}, m_Buffer = {m_Pointer = 0x19f57c0}}
> (gdb) p *pMaskL
> $83 = {<itk::ImageBase<3u>> = {<itk::DataObject> = {<itk::Object> =
> {<itk::LightObject> = {_vptr.LightObject = 0x19faaf0, m_ReferenceCount =
> {m_Object = 27248080}}, m_Debug = false, m_MTime = {m_ModifiedTime = 360},
> static m_GlobalWarningDisplay = true, m_SubjectImplementation = 0x0,
> m_MetaDataDictionary = 0x1a05140, m_ObjectName = ""}, m_Source = {m_Pointer
> = 0x0}, m_SourceOutputName = "", m_UpdateMTime = {m_ModifiedTime = 359},
> m_RealTimeStamp = {m_Seconds = 0, m_MicroSeconds = 0}, m_ReleaseDataFlag =
> false, m_DataReleased = false, m_PipelineMTime = 214, static
> m_GlobalReleaseDataFlag = false}, m_Spacing = {<itk::FixedArray<double, 3u>>
> = {m_InternalArray = {1, 1, 1}}, <No data fields>}, m_Origin =
> {<itk::FixedArray<double, 3u>> = {m_InternalArray = {87, 123, -164}}, <No
> data fields>}, m_Direction = {m_Matrix = {data_ = {{-1, 0, 0}, {0, -1, 0},
> {0, 0, 1}}}}, m_InverseDirection = {m_Matrix = {data_ = {{-1, 0, 0}, {0, -1,
> 0}, {0, 0, 1}}}}, m_IndexToPhysicalPoint = {m_Matrix = {data_ = {{-1, 0, 0},
> {0, -1, 0}, {0, 0, 1}}}}, m_PhysicalPointToIndex = {m_Matrix = {data_ =
> {{-1, 0, 0}, {0, -1, 0}, {0, 0, 1}}}}, m_OffsetTable = {1, 176, 40832,
> 10452992}, m_LargestPossibleRegion = {<itk::Region> = {_vptr.Region =
> 0xec0310 <vtable for itk::Region+16>}, m_Index = {m_Index = {0, 0, 0}},
> m_Size = {m_Size = {176, 232, 256}}}, m_RequestedRegion = {<itk::Region> =
> {_vptr.Region = 0xec0310 <vtable for itk::Region+16>}, m_Index = {m_Index =
> {0, 0, 0}}, m_Size = {m_Size = {176, 232, 256}}}, m_BufferedRegion =
> {<itk::Region> = {_vptr.Region = 0xec0310 <vtable for itk::Region+16>},
> m_Index = {m_Index = {0, 0, 0}}, m_Size = {m_Size = {176, 232, 256}}}},
> m_Buffer = {m_Pointer = 0x290}}
>
>
>
> ------------------------------------------------------------------------------------------------
> ------------------------------------------------------------------------------------------------
> Forschungszentrum Juelich GmbH
> 52425 Juelich
> Sitz der Gesellschaft: Juelich
> Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
> Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
> Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),
> Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
> Prof. Dr. Sebastian M. Schmidt
> ------------------------------------------------------------------------------------------------
> ------------------------------------------------------------------------------------------------
>
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>


More information about the Community mailing list