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

Add getter for number of total voxels to NiftiImageData #301

Merged
merged 1 commit into from Feb 5, 2019

Conversation

johannesmayer
Copy link
Member

This function is useful to loop over the elements.

@rijobro rijobro merged commit 28d4575 into SyneRBI:master Feb 5, 2019
@rijobro
Copy link
Contributor

rijobro commented Feb 5, 2019

Merged. Just for interest, I was using get_raw_nifti_sptr()->nvox before.

@KrisThielemans
Copy link
Member

can I ask how you're using this?

If we need it, we should have a virtual function higher up (which could just get it from the geo_info)

@rijobro
Copy link
Contributor

rijobro commented Feb 5, 2019

Apologies for merging, do you want me to revert?

Although we should be using geom_info, I don't fully trust it quite yet (e.g., varying slice distances for MR images). Should we make this an issue to solve in the future?

@johannesmayer
Copy link
Member Author

I decided to load the segmentation input of my simulation into a 'NiftiImageData3D' (no modality attached, just geometry and image information).

At some points I want to loop over all the pixels in the image and assign them to a specific tissue type.
I didn't see the functionality which Richard just suggested, so my code became very messy.

Don't think personally I will use it very often on top of that.

@johannesmayer johannesmayer deleted the num_voxel_getter branch February 4, 2020 12:38
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

Successfully merging this pull request may close these issues.

None yet

3 participants