I started to run ShapeWorksGroom on some real data. I have 5 binary segmentation images, each with size 512x512xZ, where Z varies from 200 to 350. I got "failed to allocate memory" errors that I attached at the end of this email. It seems the error happened when auto_cropping the second volume. I tried both the ShapeWorksGroom binary built with "OMP" on and off, and get the same error. When observing the memory usage while the code is running, I didn't see a point where memory is used up. My input volumes are all in char, in case the internal data structure depends on the input data.
weiliu@lando:/scratch/experiments/shapeworks> /scratch/packages/shapeworks.git/build/ShapeWorksGroom/ShapeWorksGroom lung.preprocess1.xml isolate hole_fill center auto_crop
isolate
PE105.nii.gz
PE900.nii.gz
PE908.nii.gz
PE916.nii.gz
PE919.nii.gz
hole_fill
PE105DT.nii.gz
PE900DT.nii.gz
PE908DT.nii.gz
PE916DT.nii.gz
PE919DT.nii.gz
center
PE105DT.nii.gz
origin = [-200.9, -156.5, -228.75]
new origin = [-183, -183, -110.312]
PE900DT.nii.gz
origin = [-172.2, -201.4, -285]
new origin = [-173.5, -173.5, -156.25]
PE908DT.nii.gz
origin = [-173.6, -200, -305]
new origin = [-200, -200, -153.125]
PE916DT.nii.gz
origin = [-126, -119.8, -262.25]
new origin = [-140.5, -140.5, -130.625]
PE919DT.nii.gz
origin = [-198.8, -206.5, -298.5]
new origin = [-220, -220, -160.625]
---------------
1 0 0 -22.3928
0 1 0 37.8377
0 0 1 -123.706
0 0 0 1
1 0 0 66.0496
0 1 0 -35.3846
0 0 1 -132.132
0 0 0 1
1 0 0 18.8881
0 1 0 1.02713
0 0 1 -151.533
0 0 0 1
1 0 0 5.90316
0 1 0 13.3788
0 0 1 -136.408
0 0 0 1
1 0 0 18.3276
0 1 0 30.1235
0 0 1 -132.154
0 0 0 1
auto_crop
WARNING! Assumes objects are centered in each image!
reading PE105DT.nii.gz
ImageRegion (0x7fffe48f4210)
Dimension: 3
Index: [75, 132, 8]
Size: [366, 240, 344]
reading PE900DT.nii.gz
ImageRegion (0x7fffe48f4210)
Dimension: 3
Index: [145, 96, 34]
Size: [197, 296, 187]
reading PE908DT.nii.gz
ImageRegion (0x7fffe48f4210)
Dimension: 3
Index: [84, 110, 33]
Size: [380, 270, 197]
reading PE916DT.nii.gz
ImageRegion (0x7fffe48f4210)
Dimension: 3
Index: [27, 116, 4]
Size: [457, 276, 204]
reading PE919DT.nii.gz
ImageRegion (0x7fffe48f4210)
Dimension: 3
Index: [100, 137, 12]
Size: [299, 207, 239]
crop size is [468, 330, 354]
cropping PE105DT.nii.gz
thisidx = [0, 0, 0]
thissz = [512, 512, 353]
lb = 18446744072788810304
lb = 65534
lb = 2
WARNING: In /scratch/packages/InsightToolkit-3.20.1/Code/Common/itkImageBase.txx, line 289
Image (0x11832a0): Not executing UpdateOutputData due to zero pixel condition RequestedRegion:ImageRegion (0x1183480)
Dimension: 3
Index: [0, 0, 0]
Size: [0, 512, 353]
BufferedRegion: ImageRegion (0x11834b8)
Dimension: 3
Index: [0, 0, 0]
Size: [512, 512, 353]
itk::ExceptionObject (0x7f2928000c90)
Location: "TElement* itk::ImportImageContainer<TElementIdentifier, TElement>::AllocateElements(itk::ImportImageContainer<TElementIdentifier, TElement>::ElementIdentifier) const [with TElementIdentifier = long unsigned int; TElement = unsigned char; itk::ImportImageContainer<TElementIdentifier, TElement>::ElementIdentifier = long unsigned int]"
File: /scratch/packages/InsightToolkit-3.20.1/Code/Common/itkImportImageContainer.txx
Line: 188
Description: Failed to allocate memory for image.
<?xml version="1.0" ?>
<!-- Preprocessing parameters 1 for Torus example -->
<!-- Value of background pixels in the image -->
<background> 0.0 </background>
<!-- Value of foreground pixels in the image -->
<foreground> 1.0 </foreground>
<!-- Number of background pixels to pad the edges of the cropped volume -->
<pad> 10 </pad>
<!-- filename to store transforms generated during preprocessing -->
<transform_file> lung.translations </transform_file>
<!-- Output progress information -->
<verbose> 1 </verbose>
<!-- Set of input files to process -->
<inputs>
PE105.nii.gz
PE900.nii.gz
PE908.nii.gz
PE916.nii.gz
PE919.nii.gz
</inputs>
<!-- Output filenames to use -->
<outputs>
PE105DT.nii.gz
PE900DT.nii.gz
PE908DT.nii.gz
PE916DT.nii.gz
PE919DT.nii.gz
</outputs>