Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Expand aa modules to run studies without DICOMs #9

Closed
alexvicegrab opened this Issue · 12 comments

4 participants

Sasha Annika Linke rhodricusack Jonathan Peelle
Sasha
Collaborator

We already have a function called aamod_epifromnifti.

I want to make 2 more: aamod_fieldmapsfromnifit, and aamod_structuralfromnifti, to allow studies to be integrated into aa even if the original DICOMs have been lost or are unavailable.

This is somewhat related to issue 4, since the TR cannot be obtained from the DICOMs in this case.

Annika Linke
Collaborator

I think the aamod_epifromnifti function should work on all files, it's a bit of a misnomer. Although I have to admit I never tried with a fieldmap. Concerning the structural, you can just use the nii file you already have for the later pre-processing stages, can't you? Why would you want a special aamod_structuralfromnifti module?

Sasha
Collaborator

Well, thing is, the normalisation stream needs to get the structural from somewhere, and it expects it comes from aamod_convertstructural. It expects a stream. So we need a module that defines where the structural comes from, no?

Annika Linke
Collaborator

Ah, yes, that's true. When normalization didn't find any structural because of the missing aamod_converstructural stage I just added a couple of lines to aamod_coreg_noss that would copy the structural nii file from the raw data directory if it couldn't find it through an input stream. But I guess we could also just include a pseudo structural conversion stage earlier.

rhodricusack
Annika Linke
Collaborator

Yes, that's why I said it's a bit of a misnomer, the aamod_epifromnifti should work on all nii files no matter whether structural, epi or fieldmap. Having said that it doesn't really make much sense to have the MPRAGE processed by epifromnii if it is already in the correct file format, hence, I didn't actually go the aas_addsubject route for the structural. Is there a way to add the structural using aas_addsubject that channels it through some other module than epifromnii? I thought there wasn't, would be even better if there was one though.

rhodricusack

I have a suggestion. Why don't we add a command like
aap=aas_addinitialstream(aap,'structural','/your/file/name.nii');

I've also been thinking that we could make the engine automatically convert the input streams to a format requested in the module's header (e.g., 3d epis or 4d file, perhaps defaulting to 3d) to ease interoperability between SPM & FSL. We could also then add an automatic tar and gzip in aas_descoutput, to reduce the number of files.

Then for free, we could have
aap=aas_addinitialstream(aap,'epi','/your/file/name.nii');
or
aap=aas_addinitialstream(aap,'epi',{'/your/file/name1.nii','/your/file/name2.nii','/your/file/name3.nii'});
and get rid of aamod_epifromnifiti completely

Sasha
Collaborator
Jonathan Peelle
Collaborator

I like this as well, as well as trying to ease interoperability between SPM and FSL.

Sasha
Collaborator

Rhodri,
I've been testing the latest version and got this error when I add a fieldmap:

??? Index exceeds matrix dimensions.

Error in ==> aas_addinitialstream at 83
matchind=length(aap.aap_beforeuserchanges.tasksettings.aamod_importfilesasstream(modposinsettings).match)+1

Error in ==> aa_user_general_aa4 at 66
aap=aas_addinitialstream(aap,'fieldmap',p, ...

Any ideas?
Thank you!

Sasha
Collaborator

Rhodri, I have traced the source of the error, and this seems to work only if you want to add one initial stream per subject, but not two...

I have fixed it in my local copy by adding the following after line 51 (since when we create a second aamod_addinitialstream module, the aap.aap_beforeuserchanges for the first one ends up containing an empty match field):

aap.aap_beforeuserchanges.tasksettings.aamod_importfilesasstream = aap.tasksettings.aamod_importfilesasstream;

Additionally, I substituted line 84 (?), since I had an error whenever I tried to add a 2nd stream:
%matchind=length(aap.aap_beforeuserchanges.tasksettings.aamod_importfilesasstream(modposinsettings).match)+1;
matchind=length(aap.tasksettings.aamod_importfilesasstream(modposinsettings).match)+1;

Do these changes make sense, and shall I commit them?

rhodricusack

Sasha, Yes, they make sense, please do commit them! Thanks

Sasha
Collaborator

Now it should work, so I'll temporarily close the issue. Please reopen if there's any more issues...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.