Skip to content

Parameters setting of slice_acquisition()聽#8

Description

@Leong1230

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions