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

RadQy Dimension Error with Diffusion Weighted Imaging #45

Open
kyle-sullivan315 opened this issue Jan 8, 2025 · 0 comments
Open

RadQy Dimension Error with Diffusion Weighted Imaging #45

kyle-sullivan315 opened this issue Jan 8, 2025 · 0 comments
Assignees

Comments

@kyle-sullivan315
Copy link

Hello, my team and I are attempting to run radqy on our BIDS dataset (nii.gz - compressed nifti files). So far the tool is able to process our anatomical scans, but we are hitting an issue with our diffusion weighted imaging (dwi) scans. For dwi scans with just one volume, there is no issue. But for our dwi scans with more than one volume, we get the following error:

Traceback (most recent call last):
File ".../radqy-0.1.5/bin/radqy", line 8, in
sys.exit(run_cli())
File ".../radqy-0.1.5/lib/python3.10/site-packages/radqy/cli.py", line 44, in run_cli
main(args)
File ".../radqy-0.1.5/lib/python3.10/site-packages/radqy/radqy.py", line 616, in main
s = IQM(v, name, total_participants, participant_index, subject_type, total_tags, fname_outdir, save_masks_flag,functions, sample_size, scan_type)
File ".../radqy-0.1.5/lib/python3.10/site-packages/radqy/radqy.py", line 452, in init
self.save_image(participant, I, j, folder)
File ".../radqy-0.1.5/lib/python3.10/site-packages/radqy/radqy.py", line 482, in save_image
plt.imsave(image_path, I, cmap=cm.Greys_r)
File ".../radqy-0.1.5/lib/python3.10/site-packages/matplotlib/pyplot.py", line 2604, in imsave
matplotlib.image.imsave(fname, arr, **kwargs)
File ".../radqy-0.1.5/lib/python3.10/site-packages/matplotlib/image.py", line 1636, in imsave
rgba = sm.to_rgba(arr, bytes=True)
File ".../radqy-0.1.5/lib/python3.10/site-packages/matplotlib/cm.py", line 399, in to_rgba
raise ValueError("Third dimension must be 3 or 4")
ValueError: Third dimension must be 3 or 4

It appears to be an issue creating the .pngs where the dimensions of the nifti files are not compatible with RGB or RGB-A format, but again, only when the scan has multiple volumes. Investigating the shape of the scans using a python tool called nibabel gives the following:
single volume scan shape: (140, 140, 22)
multiple volume (5) scan shape: (160, 160, 22, 5)

Have you encountered this error before? Do you know of a work around or fix? Thanks.

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

2 participants