[Insight-developers] Exception in itkImageToImageFilter.txx for itkPhilipsRECImageIOOrientationTest

Don C Bigler d.bigler1 at gmail.com
Thu Jul 21 17:12:03 EDT 2011


All,
  I am getting the following exception in
itkPhilipsRECImageIOOrientationTest after updating to the latest
Master branch:

627/1769 Testing: itkPhilipsRECImageIOOrientationTest2
627/1769 Test: itkPhilipsRECImageIOOrientationTest2
Command: "/Users/dbigler/Development/ITKV4Build/bin/ITK-IO-PhilipsRECTestDriver"
"--compare" "/Users/dbigler/Development/ITKV4Build/ExternalData/Modules/IO/PhilipsREC/test/Baseline/itkPhilipsRECImageIOOrientationTest2.mha"
"/Users/dbigler/Development/ITKV4Build/Testing/Temporary/itkPhilipsRECImageIOOrientationTest2.mha"
"itkPhilipsRECImageIOOrientationTest"
"/Users/dbigler/Development/ITKV4Build/ExternalData/Modules/IO/PhilipsREC/test/Input/Test_Orientation_2_5.PAR"
"/Users/dbigler/Development/ITKV4Build/ExternalData/Modules/IO/PhilipsREC/test/Input/Test_Orientation_2_1.REC.gz"
"/Users/dbigler/Development/ITKV4Build/Testing/Temporary/itkPhilipsRECImageIOOrientationTest2.mha"
Directory: /Users/dbigler/Development/ITKV4Build/Modules/IO/PhilipsREC/test
"itkPhilipsRECImageIOOrientationTest2" start time: Jul 20 23:18 CDT
Output:
----------------------------------------------------------

itk::ExceptionObject (0x1012cafc0)
Location: "void itk::ImageToImageFilter<TInputImage,
TOutputImage>::VerifyInputInformation() [with TInputImage =
itk::Image<short int, 3u>, TOutputImage = itk::Image<short int, 3u>]"
File: /Users/dbigler/Development/ITK/Modules/Core/Common/include/itkImageToImageFilter.txx
Line: 253
Description: itk::ERROR: ResampleImageFilter(0x1012b72b0): Inputs do
not occupy the same physical space!
InputImage Origin: [-107.993, -73.195, 114.799], InputImage1 Origin:
[-132.601, -135.137, -62.593]
InputImage Spacing: [0.807, 0.807, 1], InputImage1 Spacing: [1, 1, 1]
InputImage Direction: 1 0 0
0 0 1
0 -1 0
, InputImage1 Direction: 1 0 0
0 1 0
0 0 1




<DartMeasurement name="ImageError" type="numeric/double">0</DartMeasurement>
<DartMeasurement name="BaselineImageName"
type="text/string">itkPhilipsRECImageIOOrientationTest2.mha</DartMeasurement>
<end of output>
Test time =   1.31 sec

It looks like a check is made to verify that the origin and direction
cosines are the same.  Probably not a bad check for most situations,
but it appears to break this test that I created to test the
orientation of the Philips PAR/REC images.  Here's what I'm doing in
the test:

1.  I have two images acquired during the same scan session, one in an
axial orientation and the other is the same image in the sagittal
orientation created using multi-planar reconstruction.
2.  Read both images.
3.  Transform the sagittal image to the axial image using the identity
affine matrix.  The identity transform is used because the images
differ in orientation only.
4.  Subtract the transformed sagittal image from the axial image.
Visual inspection using an image viewer shows that they are correctly
coregistered.

The reason they are correctly coregistered is because ITK handles the
conversion from image coordinates to real world coordinates
"automatically" using the origin and direction cosines.

Having explained all this (hopefully with adequate clarity and
correctness), it seems to me that this exception that is generated is
a bug.  I would appreciate it if someone else will verify the
exception that I'm getting and provide an explanation as to why this
check was added in ITK4.

Don


More information about the Insight-developers mailing list