[ITK] PasteImageFilter

David Froger david.froger.ml at mailoo.org
Wed May 7 05:18:46 EDT 2014


Hi,

I have a 3D vector image scatterd in multiple HDF5 files, one of each containing a
3D vector region of the image.

I want to loop on all files and write the whole 3D vector image to the disk, but by
allocating memory for only the small regions of the 3D vector image, not the whole
3D vector image.

The code I wrote fails and I don't know how to fix the error. For clarity, I
left all the implementation details in the attached files.

Any help or suggestion welcome!

Thanks,
David

-------------- next part --------------
# Build
mkdir build
cd build
cmake ..
make

# Create an 3D vector image image of size (5,4,3,2) scattered in 3 files
#        SZ SY SX SC IZ IY NZ NY
./create  5  4  3  2  0  0  2  4  # contains region: index: (0,0,0,0) size: (2,4,3,2)
./create  5  4  3  2  2  0  2  4  # contains region: index: (2,0,0,0) size: (2,4,3,2)
./create  5  4  3  2  4  0  1  4  # contains region: index: (4,0,0,0) size: (1,4,3,2)

# Gather in one file the 3D vector image of size (5,4,3,2)
./gather *.h5

The last command fails with the error message:

terminate called after throwing an instance of 'itk::ExceptionObject'
  what():  /home/ROCQ/clime/common/opt/itk/h5streamwrite/include/ITK-4.4/itkImageFileWriter.hxx:284:
itk::ERROR: ImageFileWriter(0x224bba0): Largest possible region does not fully contain requested paste IO regionPaste IO region: ImageIORegion (0x7fff5f7e1160)
  Dimension: 3
  Index: 0 0 2
  Size: 3 4 2
Largest possible region: ImageRegion (0x7fff5f7e11e0)
  Dimension: 3
  Index: [0, 0, 2]
  Size: [3, 4, 2]

Abandon (core dumped)
-------------- next part --------------
cmake_minimum_required(VERSION 2.8)

FIND_PACKAGE(ITK)

SET(CMAKE_BUILD_TYPE debug)

IF(ITK_FOUND)
    INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
    MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.")
ENDIF(ITK_FOUND)

ADD_EXECUTABLE(create create.cxx)
ADD_EXECUTABLE(gather gather.cxx)

TARGET_LINK_LIBRARIES(create ${ITK_LIBRARIES})
TARGET_LINK_LIBRARIES(gather ${ITK_LIBRARIES})

-------------- next part --------------
A non-text attachment was scrubbed...
Name: create.cxx
Type: text/x-c
Size: 3198 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20140507/08557ea4/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gather.cxx
Type: text/x-c
Size: 5105 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20140507/08557ea4/attachment-0001.bin>


More information about the Community mailing list