Skip to content

Conversation

@joeykleingers
Copy link
Contributor

@joeykleingers joeykleingers commented Jan 27, 2026

Summary

Enhances ITK image reading filters with 2D-aware cropping capabilities and configurable origin/spacing processing timing, providing more flexible image import workflows.

Key Changes

CropGeometryParameter Enhancement

  • Added is_2d flag to CropGeometryParameter to support 2D image cropping
  • Enables proper cropping of 2D images without Z-axis constraints

ITKImageReader & ITKImportImageStack Improvements

  • Added cropping options: Both filters now support voxel-based and physical subvolume cropping during image import
  • Origin & Spacing Processing parameter: New parameter controls whether user-specified origin/spacing values are applied before (preprocessed) or after (postprocessed) image reading and cropping
    • Preprocessed: Origin/spacing applied before cropping (affects crop bounds interpretation)
    • Postprocessed: Origin/spacing applied after cropping (simpler workflow)
  • Updated ReadImageUtils to handle cropping and origin/spacing processing timing

Testing

  • Completely rewrote ITKImageReaderTest and ITKImportImageStackTest to comprehensively test all code paths and feature interactions
  • Tests now validate all combinations of cropping, origin/spacing override, data type conversion, and processing timing

Testing Performed

  • All new test cases pass with exemplar validation
  • Tested 2D and 3D image cropping scenarios
  • Verified origin/spacing processing in both pre and post modes
  • Validated data type conversions with cropping

NOTE

This PR goes hand in hand with #1030 and should be approved and merged with it.

Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
…cks.

Also passed in NoCropping cropping options to Fiji Montage reader because
it uses the same ITK Image Reader execute API.  Still need to expose the
cropping options for Fiji Montage reader as a filter parameter.

Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
… stack reader.

This parameter determines whether the origin & spacing set by the user is set
before or after reading and cropping/processing the image(s).

Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
@joeykleingers joeykleingers added the enhancement New feature or request label Jan 27, 2026
Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
@joeykleingers joeykleingers force-pushed the topic/CropImageGeometryParameter2D branch from 44b8b31 to 72d8e3b Compare January 27, 2026 18:39
Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
@joeykleingers joeykleingers force-pushed the topic/CropImageGeometryParameter2D branch from 72d8e3b to dd59d60 Compare January 27, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant