SVoRT icon indicating copy to clipboard operation
SVoRT copied to clipboard

Parameters setting of slice_acquisition()

Open Leong1230 opened this issue 1 year ago โ€ข 0 comments

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!

Leong1230 avatar Sep 28 '24 22:09 Leong1230