-
Notifications
You must be signed in to change notification settings - Fork 2
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
Error in if (any(bad_pixdim)) { : missing value where TRUE/FALSE needed #4
Comments
gzip is a type of zipping that's different from zip. If you want to zip an individual file, you should use gzip file.nii. Also, the above code zipped up a number of files, you should likely pass only 1 in. Please provide a MCVE: https://stackoverflow.com/help/mcve. In any example, I recommend using a reproducible example using the reprex package (https://github.com/tidyverse/reprex). Also, please include a sessioninfo::session_info() output. |
Hello again, I was wondering why you say to zip only a single file when I have multiple .nii files from different time points in a single fmri session and want to use all of them? Here is my MCVE: library(oro.nifti) When I do this I get the error: 'Error in if (any(bad_pixdim)) { : missing value where TRUE/FALSE needed' This error does not occur when I do readnii("singlefile.nii") Here is my sessioninfo: ─ Session info ─────────────────────────────────────────────────────────────── |
Thanks - but the MCVE is only verifiable with the file. The fmri.nii.gz is a 4D NIfTI file of all the images, not a zipped directory of nii files, correct? If so, please post. |
Hello, I believe that fmri.nii.gz is a zipped directory of the nii files. I believe this because I have a folder of multiple nii files and I zipped them together using 'zip fmri.nii.gz s*.nii'. If it helps, this is what happens when I do readnii(singlefile.nii): NIfTI-1 format Thank you for your help! |
So you need to merge all the 3D files into a 4D file before running,
you cannot upload a zip file of 3D files. See something like fslmerge:
https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Fslutils or
http://akiraoconnor.org/2012/04/25/converting-3d-nifti-images-to-a-4d-image-with-spm/
Best,
John
…On Mon, Dec 21, 2020 at 1:39 PM rudolph-the-red-nose-reindeer < ***@***.***> wrote:
Hello, I believe that fmri.nii.gz is a zipped directory of the nii files.
I believe this because I have a folder of multiple nii files and I zipped
them together using 'zip fmri.nii.gz s*.nii'.
If it helps, this is what happens when I do readnii(singlefile.nii):
NIfTI-1 format
Type : nifti
Data Type : 4 (INT16)
Bits per Pixel : 16
Slice Code : 0 (Unknown)
Intent Code : 0 (None)
Qform Code : 1 (Scanner_Anat)
Sform Code : 1 (Scanner_Anat)
Dimension : 64 x 64 x 36
Pixel Dimension : 3.75 x 3.75 x 4
Voxel Units : mm
Time Units : sec
Thank you for your help!
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIGPLWS7B2IZHACJLZNOMLSV6I6VANCNFSM4VEQ7DNQ>
.
|
Hello, I had a folder of .nii fmri files that I made into a gz file using 'zip fmri.nii.gz s*.nii'. The above error comes up when I run 'func = readnii("fmri.nii.gz")'. I am trying to use this as an input into the beginning of your preprocessing pipeline 'files = c(anatomical = anat, functional = func)'. I was wondering if you know of any fix to this error, or if you have any recommendations on how to input my own files to your pipeline. Thank you so much!
The text was updated successfully, but these errors were encountered: