Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters setting of slice_acquisition() #8

Open
Leong1230 opened this issue Sep 28, 2024 · 0 comments
Open

Parameters setting of slice_acquisition() #8

Leong1230 opened this issue Sep 28, 2024 · 0 comments

Comments

@Leong1230
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant