ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
638 stars 162 forks source link

crop_indices #418

Closed samtorrisi closed 1 year ago

samtorrisi commented 1 year ago

Am I missing something or does ants.crop_indices() only work in 2D not 3D? I could convert to np and back but would ants.decrop_image() still work? thanks

stnava commented 1 year ago

Try this and report back?

import ants

ch2=ants.image_read( ants.get_data("ch2"))

ants.crop_indices( ch2, [20,20,20], [40,40,40] )

On Mon, Dec 19, 2022 at 5:17 PM salvatore (sam) torrisi < @.***> wrote:

Am I missing something or does ants.crop_indices() only work in 2D not 3D? I could convert to np and back but would ants.decrop_image() still work? thanks

— Reply to this email directly, view it on GitHub https://github.com/ANTsX/ANTsPy/issues/418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACPE7QDFHXPAMOIUWSZZ4TWODNFZANCNFSM6AAAAAATD22OA4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

brian

samtorrisi commented 1 year ago

ok that worked, thanks. the help file example had parentheses not square brackets; i should've known (SMH). i think depending on dimensions you crop to and their relation to Origin, however, it seems ants.plot() sometime will or won't work. no biggie and thanks for the lightning fast response.