SVoRT
SVoRT copied to clipboard
Parameters setting of slice_acquisition()
Hi, I would like to use the slice_acquisition() function to extract 2D slices from a 3D volume, but I am unsure about how to properly configure the input parameters.
I have a 3D volume with the following properties:
Size: ๐ร๐ปร๐
Spacing: (๐ ๐ฅ,๐ ๐ฆ,๐ ๐ง)
Orientation matrix: ๐ (3ร3)
Origin: (๐ฅ,๐ฆ,๐ง)
I would like to extract a 2D slice of size ๐ป1ร๐1, with spacing (๐ ๐ฅ1,๐ ๐ฆ1) using the slice_acquisition() function and a known transformation matrix ๐ (4ร4), which implements the same function as:
resampler = sitk.ResampleImageFilter()
resampler.SetOutputDirection(slice_orientation])
resampler.SetOutputOrigin(slice_origin)
resampler.SetOutputSpacing(slice_spacing)
resampler.SetSize(slice_shape)
resampler.SetInterpolator(sitk.sitkNearestNeighbor)
# Resample the volume on the arbitrary plane
sliced_image = resampler.Execute(volume)
Thank you!