[ITK] PasteImageFilter versus TileImageFilter

Wood, Tobias tobias.wood at kcl.ac.uk
Tue May 3 12:01:49 EDT 2016


Hello,

I have two linked questions:
1 - What is the correct way to set the direction/spacing etc. of TileImageFilter?

2 - Is it possible to run PasteImageFilter in-place? i.e. overwrite a section of the destination image?

I have a pipeline where the input is a 4D file. I extract each 3D volume, process it, and then need to combine the 3D volumes back into a 4D file with the same direction/spacing as the input. I was using TileImageFilter to do this, but I observed that the direction/spacing did not match the input. I resorted to disconnecting the pipeline from the output image and copying the direction/spacing manually from the input image. You can see that version of the pipeline here: https://github.com/spinicist/QUIT/blob/development/Source/qikfilter.cpp. Is there a more ‘correct’ way to do this?

As an alternative, today I experimented with PasteImageFilter. I was hoping to be able to run this in-place to save memory, but if I set InPlaceOn(), I get the following error:

libc++abi.dylib: terminating with uncaught exception of type itk::ExceptionObject: …/ITK/Modules/Core/Common/src/itkMultiThreader.cxx:420:
itk::ERROR: MultiThreader(0x7f8509009600): Exception occurred during SingleMethodExecute
…/include/ITK-4.10/itkImageConstIterator.h:211:
itk::ERROR: Region ImageRegion (0x7fff52f4f980)
  Dimension: 4
  Index: [0, 0, 0, 1]
  Size: [96, 96, 24, 1]
 is outside of buffered region ImageRegion (0x7f850998dd80)
  Dimension: 4
  Index: [0, 0, 0, 0]
  Size: [0, 0, 0, 0]


Which suggests the output is not being allocated (which I guess it shouldn’t)? So do I need to do something more than set InPlaceOn()?

Thanks,
Toby


More information about the Community mailing list