I have a script that loads a tiff image using tifffile into numpy and converted to sitk, and apply a transform stack on the image. It works with an older version of SimpleITK but not the latest.
The latest version of SimpleITK installed with:
pip install --upgrade --pre SimpleITK --find-links https://github.com/SimpleITK/SimpleITK/releases/tag/latest
It processes the files up until the 18th transform and then gives this weird error that I don’t get when running the same script with the last release version (simpleitk-1.2.2):
I understand what it’s saying to the extent that there is a mismatch in the images sizes, but I don’t know how to debug it or maybe flush some kind of cache or wait until the image has been fullly read?
the moving image (17, 18)
Debug: ResampleImageFilter (0x7fbe26e9f1a0): Executing ITK filter:
ResampleImageFilter (0x7fbe2710e390)
RTTI typeinfo: itk::ResampleImageFilter<itk::Image<unsigned char, 2u>, itk::Image<unsigned char, 2u>, double, double>
Reference Count: 1
Modified Time: 18042
Debug: Off
Object Name:
Observers:
DeleteEvent(SimpleMemberCommand)
Inputs:
Primary: (0x7fbe2710b910) *
ReferenceImage: (0x0)
Transform: (0x7fbe2710ea40) *
Indexed Inputs:
0: Primary (0x7fbe2710b910)
1: ReferenceImage (0x0)
Required Input Names: Primary, Transform
NumberOfRequiredInputs: 1
Outputs:
Primary: (0x7fbe2710e530)
Indexed Outputs:
0: Primary (0x7fbe2710e530)
NumberOfRequiredOutputs: 1
Number Of Work Units: 4
ReleaseDataFlag: Off
ReleaseDataBeforeUpdateFlag: Off
AbortGenerateData: Off
Progress: 0
Multithreader:
RTTI typeinfo: itk::PoolMultiThreader
Reference Count: 1
Modified Time: 18011
Debug: Off
Object Name:
Observers:
none
Number of Work Units: 4
Number of Threads: 4
Global Maximum Number Of Threads: 128
Global Default Number Of Threads: 4
Global Default Threader Type: PoolMultiThreader
SingleMethod: 0
SingleData: 0x0
DynamicMultiThreading: On
CoordinateTolerance: 1e-06
DirectionTolerance: 1e-06
DefaultPixelValue: 243
Size: [1024, 1024]
OutputStartIndex: [0, 0]
OutputSpacing: [4.04, 4.04]
OutputOrigin: [0, 0]
OutputDirection: 1 0
0 1
Transform: 0x7fbe26d4b300
Interpolator: 0x7fbe2710e850
Extrapolator: 0x0
UseReferenceImage: Off
Traceback (most recent call last):
File "create_stack.py", line 217, in <module>
main()
File "create_stack.py", line 178, in main
mean = utils.get_mean_edges(t_sitk)
File "/Users/sansomk/code/python/Tools/hist/utils.py", line 205, in resample_1_rgb
new_image = filter_.Execute(t_sitk)
File "/Users/sansomk/anaconda3/envs/reg/lib/python3.7/site-packages/SimpleITK/SimpleITK.py", line 59346, in Execute
return _SimpleITK.ResampleImageFilter_Execute(self, *args)
RuntimeError: Exception thrown in SimpleITK ResampleImageFilter_Execute: /Users/runner/runners/2.164.7/work/1/sitk/Code/Common/src/sitkPimpleImageBase.hxx:75:
sitk::ERROR: The image has a LargestPossibleRegion of ImageRegion (0x7fbe2710ba50)
Dimension: 2
Index: [0, 0]
Size: [1024, 1024]
while the buffered region is ImageRegion (0x7fbe2710baa0)
Dimension: 2
Index: [0, 0]
Size: [1024, 971]
SimpleITK does not support streamming or unbuffered regions!