spinicist / nanslice

A Python implementation of 'dual-coding'
Mozilla Public License 2.0
39 stars 9 forks source link

Viewing 4D data #1

Open emilljungberg opened 6 years ago

emilljungberg commented 6 years ago

Current implementation doesn't seem to support 4D data. Would be neat to be able to specify which image in the 4th dimension to view, like a specific TE.

spinicist commented 6 years ago

Can you provide an example of the code you tried, and what the errors were please?

This is a known short-coming in nanslice. For 4D files so far, I have resorted to manually selecting the volume I want, and then creating a new Nifti1Image with only that volume. For example:

single_vol = all_img.get_data()[:,:,:,0]
single_img = nib.Nifti1Image(single_vol, affine=all_img.affine)

Thanks!