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

NIfTI input data format #82

Closed
giuseppecabras opened this Issue Mar 25, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@giuseppecabras
Copy link

giuseppecabras commented Mar 25, 2015

Dear Rhodri,
I need your help again! I would like to use data already in NIfTI but I havn't found instructions or examples to do so and I have, for example, T1 and EPI converted NIfTI files ready for an fMRI pipeline. I read in your paper that I can use the aas_addinitialstream command, but I don't know how.
Cheers,
Giuseppe

@giuseppecabras

This comment has been minimized.

Copy link
Author

giuseppecabras commented Mar 26, 2015

Hi,
following the help aas_addinitialstream and some try/error loops, I found that this work in my basic user script: with my aap_tasklist_fmri_fromnifti.xml
% The subject
aap=aas_addsubject(aap,'PUD400614',{'31147_MRI_rsMRI_400614.nii','31148_MRI_sMRI_400614.nii'});
aap=aas_addinitialstream(aap,'structural','PUD400614','/home/gc/wp3data/UD/31148_MRI_sMRI_400614.nii');
aap=aas_addinitialstream(aap,'epi','PUD400614','/home/gc/wp3data/UD/31147_MRI_rsMRI_400614.nii');
... but I think more detailed instructions/examples can be useful.

Best,
Giuseppe

@tiborauer

This comment has been minimized.

Copy link
Member

tiborauer commented Apr 14, 2015

Why do not you simply do:
aap=aas_addsubject(aap,'PUD400614',{'/home/gc/wp3data/UD/31148_MRI_sMRI_400614.nii','/home/gc/wp3data/UD/31147_MRI_rsMRI_400614.nii'});

I recommend you typing:
help aas_addsubject
to see the documentation.

Vale,
Tibor

@giuseppecabras

This comment has been minimized.

Copy link
Author

giuseppecabras commented Apr 14, 2015

Thanks Tibor,
I thought that for NIfTI input files, aas_addinitialstream was needed to specify the type of data stream (epi or structural) when more then one type are used by the recipe. But also, I see that in "fromnifti" recipes I need a special "fromnifti" module (like aamod_epifromnifti) which are not generally available. Some more example of "fromnifti" user scripts or a special documentation resource for NIfTI input data would be useful.
Best,
Giuseppe

@tiborauer

This comment has been minimized.

Copy link
Member

tiborauer commented Apr 14, 2015

aamod_epifromnifti and aamod_structuralfromnifti are there
But you are right, we may need to update our example scipts.

@conorwild

This comment has been minimized.

Copy link
Collaborator

conorwild commented Apr 14, 2015

Hi Giuseppe,

There are a couple ways to accomplish what you want to do (starting with converted nifti images), and our documentation could really use some updating with the details. I'll work on that!

You are correct in that you can use aas_addinitialstream() to import your epi and structural images. This is quite easy for the structural stream, and the code you provided earlier should work:

aap=aas_addinitialstream(aap,'structural','PUD400614','/home/gc/wp3data/UD/31148_MRI_sMRI_400614.nii');

Things are a little more complicated for the epis, because you would also need create and import a dicom_header stream (that contains information about the TR, TE, etc.). Luckily, this is all made easier by the aamod_epifromnifti module that Tibor referenced; it will create the epi streams and the corresponding dicom_header files. Just make sure that you set the options (TR and TE) in aamod_epifromnifti.xml, or in your user script like this:

aap.tasksettings.aamod_epifromnifti.TR = 1920; % in millseconds
aap.tasksettings.aamod_epifromnifti.TE = 20; % also in milliseconds

As Tibor pointed out, aamod_epifromnifti knows how to find the epi images for each subject because you specify them in aas_addsubject(), like this:

aap=aas_addsubject(aap,'PUD400614',{'/home/gc/wp3data/UD/31148_MRI_sMRI_400614.nii','/home/gc/wp3data/UD/31147_MRI_rsMRI_400614.nii'});

Note that aas_addsubject() expects the third input to be a cell array of file names (one cell for each epi image). If you have multiple sessions, then it should be a cell array of cell arrays!

Hope this helps, please let us know if you encounter any further problems. Thank you!

Conor

@tiborauer

This comment has been minimized.

Copy link
Member

tiborauer commented Apr 14, 2015

Hi Guiseppe,

I have updated the examples (in devel-share branch).
See examples/aa_user_fmri_fromnifti.m.

Vale,
Tibor

@tiborauer tiborauer closed this Jul 22, 2015

jooh pushed a commit to jooh/automaticanalysis that referenced this issue Feb 21, 2019

Merge pull request automaticanalysis#82 from tiborauer/standalone
DEBUG: standalone according to the recent updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.