<p dir="ltr">Hi,<br>
I had to change the tolerance in some of the functions that evaluate origin when using ITK. I dont remember the code I used to change it but when I get to work I will search one of the examples I ran and send you the variable you need to change.<br>
Can you upload the input images somewhere?<br>
Regards,<br></p>
<p dir="ltr">Matias</p>
<div class="gmail_quote">On Sep 17, 2015 4:44 AM, "P. Pieperhoff" <<a href="mailto:p.pieperhoff@fz-juelich.de">p.pieperhoff@fz-juelich.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Dear ITK-Users,<br>
<br>
I want to use the bias field correction filter itk::N4BiasFieldCorrectionImageFilter with a mask, that indicates the voxels where the intensities shall be corrected.<br>
<br>
I have attached the code of my filter implementation. The program is called as<br>
<br>
<tt>N4_test inputimage.nii mask.nii output.nii<br>
<br>
</tt><br>
However, the program crashes with the following error message:<br>
<br>
>>>>><br>
<tt></tt><tt>terminate called after throwing an instance of 'itk::ExceptionObject'</tt><tt><br>
</tt><tt> what(): /develop/ITK/ITK-4.8.0/InsightToolkit-4.8.0/Modules/Core/Common/include/itkImageToImageFilter.hxx:248:</tt><tt><br>
</tt><tt>itk::ERROR: N4BiasFieldCorrectionImageFilter(0x299f3d0): Inputs do not occupy the same physical space!
</tt><tt><br>
</tt><tt>InputImage Origin: [8.7000000e+01, 1.2300000e+02, -1.6400000e+02], InputImage_1 Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00]</tt><tt><br>
</tt><tt> Tolerance: 1.0000000e-06</tt><tt><br>
</tt><tt>InputImage Direction: -1.0000000e+00 0.0000000e+00 0.0000000e+00</tt><tt><br>
</tt><tt>0.0000000e+00 -1.0000000e+00 0.0000000e+00</tt><tt><br>
</tt><tt>0.0000000e+00 0.0000000e+00 1.0000000e+00</tt><tt><br>
</tt><tt>, InputImage_1 Direction: 1.0000000e+00 0.0000000e+00 0.0000000e+00</tt><tt><br>
</tt><tt>0.0000000e+00 1.0000000e+00 0.0000000e+00</tt><tt><br>
</tt><tt>0.0000000e+00 0.0000000e+00 1.0000000e+00</tt><tt><br>
</tt><tt><br>
</tt><tt> Tolerance: 1.0000000e-06</tt><tt><br>
</tt><tt><br>
</tt><tt>Aborted</tt><tt><br>
</tt><tt></tt><tt><br>
</tt><tt><br>
</tt><<<<<<<br>
<br>
<br>
But the sizes, origins and the direction matrices of the input image and mask are definitively identical.<br>
Below is the debug information of the input and mask image, before the program crashes.<br>
<br>
<br>
I'm using ITK version 4.8.0 on Debian-Linux.<br>
<br>
Please could anyone help me to get the program running?<br>
Thanks a lot in advance!<br>
<br>
Peter<br>
<br>
<br>
<br>
<br>
<tt>(gdb) p *pInputImage</tt><tt><br>
</tt><tt>$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},
<font color="#ff0000">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}}}},</font> 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}}</tt><tt><br>
</tt><tt>(gdb) p *pMaskL</tt><tt><br>
</tt><tt>$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},<font color="#ff0000"> 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}}}},
</font>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}}</tt><tt><br>
</tt><br>
<br>
<font face="Arial" color="Black" size="1"><br>
------------------------------------------------------------------------------------------------<br>
------------------------------------------------------------------------------------------------<br>
Forschungszentrum Juelich GmbH<br>
52425 Juelich<br>
Sitz der Gesellschaft: Juelich<br>
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498<br>
Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher<br>
Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt (Vorsitzender),<br>
Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,<br>
Prof. Dr. Sebastian M. Schmidt<br>
------------------------------------------------------------------------------------------------<br>
------------------------------------------------------------------------------------------------<br>
<br>
</font>
</div>
<br>_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><br>
<br></blockquote></div>