You can clone with
HTTPS or Subversion.
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.
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?
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?
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.
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.
I have a suggestion. Why don't we add a command like
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
and get rid of aamod_epifromnifiti completely
I like this as well, as well as trying to ease interoperability between SPM and FSL.
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
Error in ==> aa_user_general_aa4 at 66
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:
Do these changes make sense, and shall I commit them?
Sasha, Yes, they make sense, please do commit them! Thanks
Now it should work, so I'll temporarily close the issue. Please reopen if there's any more issues...