Coder Social home page Coder Social logo

automaticanalysis / automaticanalysis Goto Github PK

View Code? Open in Web Editor NEW
70.0 18.0 39.0 93.04 MB

Automatic Analysis (aa)

Home Page: http://automaticanalysis.github.io

License: MIT License

MATLAB 99.71% M 0.03% CSS 0.02% Shell 0.24%
matlab pipeline fmri eeg diffusion parallel-computing workflow-engine workflow-automation big-data dataflow neuroimaging

automaticanalysis's Introduction

Automatic Analysis (aa) is a pipeline system for neuroimaging written primarily in Matlab. It supports SPM 12, as well as selected functions from other software packages (e.g., FSL, Freesurfer). The goal is to facilitate automatic, flexible, and replicable neuroimaging analyses through a comprehensive pipeline system.

The software was originally developed by Dr Rhodri Cusack for supporting research at the MRC Cognition and Brain Science Unit. It is made available to the academic community in the hope that it may prove useful.

CI Docker image available! manuscript resource DOI View Automatic Analysis (aa) on File Exchange

Definitions: aa means the Automatic Analysis software package and any associated documentation whether electronic or printed.

License

Use of this software is subject to the terms of the license, found in the license.txt file distributed with this software.

Documentation

The best source for aa documentation is the github wiki at: https://github.com/automaticanalysis/automaticanalysis/wiki

A second website at http://automaticanalysis.github.io provides recent aa news and current events, as well as discussion of topics that might be of interest to aa developers.

Help and support

Please feel free to open a discusion thread or an issue here on GitHub if you want to make comment or suggestions or are having trouble getting aa to work.

Software updates

The master branch on github is only updated after testing, so this version is the one to use. Developer versions are maintained in each developer's aa fork on GitHub.

References and citation

For any papers that report data analyzed with aa, please include the GitHub repo URL and cite the aa paper:

Cusack R, Vicente-Grabovetsky A, Mitchell DJ, Wild CJ, Auer T, Linke AC, Peelle JE (2015) Automatic analysis (aa): Efficient neuroimaging workflows and parallel processing using Matlab and XML. Frontiers in Neuroinformatics 8:90. http://dx.doi.org/10.3389/fninf.2014.00090

automaticanalysis's People

Contributors

alexvicegrab avatar aljenu avatar conorwild avatar dprice80 avatar ethanknights avatar hhentschke avatar jones-michael-s avatar jooh avatar jpeelle avatar rhodricusack avatar tamergezici avatar tiborauer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

automaticanalysis's Issues

Using nifti images rather than converting from DICOM (aamod_t1fromnifti)

I have a set of converted structural images (nifti) which have been manually repositioned, so I do not want to re-convert them, but simply pop the nifti images into a processing stream.

I see aamod_epifromnifti; unless there is another option, my plan is to write something similar for t1 images, perhaps with the option of copying or softlinking.

Am I missing something that already exists? Any suggestions?

[developent] dependencies between functions, etc.

It would be nice to know which functions are used in each function, so that we, as developers can know what dependencies there are for the different functions.

While we worked on the amazon server stuff, I had some scripts that found dependencies in matlab files, but can't seem to find it any more. Perhaps we could include this (if Rhodri still has it), or I could rewrite it from scratch.

This would help with migrating some .m files from extrafunctions to the main engine, and show if there's any things that do not depend on anything, etc.

What do you think?
S.

missing function

Hello,

does anyone know the whereabouts of aas_getfslext.m ? It's needed for searchlight MVPA.

Thanks,
Annika

branching and streams

Hello (aa-github) world!

I'm trying to use branches in my tasklist, but I can't figure out how to ensure that branches retrieve the correct input stream. I tried to use aap_tasklist_branching_example3.xml from https://github.com/rhodricusack/automaticanalysis/wiki/Branched-tasklists (with some very small changes), which has two main branches (realign before slicetime; slicetime before realign), the second of which has a further nested two branches (two different smoothing kernels).

The first aamod_smooth gets the correct input (i.e., output of aamod_norm_write), but the penultimate and ultimate aamod_smooth inputs revert to the output of aamod_convert_epis!:

Stage aamod_smooth input epi comes from aamod_norm_write which is 1 dependencies prior [correct!]
...
Stage aamod_smooth input epi comes from aamod_convert_epis which is 1 dependencies prior [incorrect!]
Stage aamod_smooth input epi comes from aamod_convert_epis which is 1 dependencies prior [incorrect!]

I tried to specify the specific input I wanted in the final nested branches by setting the aamod_smooth input stream to aamod_norm_write_00002.epi, but it still set the input to the output of aamod_convert_epis.

Is there a way to specify that the inputs of a module in a nested branch should come from the branch in which it is nested (rather than the trunk)?

Thanks,
Jason.

aamod_firstlevel_contrasts "uniquebysession" option

Hello,

The uniquebysession option is not fully functional. Right now, it seems to not recognise all nuisance variables [e.g. CompRegs] and other nuisance covariates, but only movement regressors, so you need to explicitly include them in the regressor. I think we could enhance it to recognise these extra nuisance regressors.

Thanks!
S.
p.s. since it's been me who has added the covariates/compRegs, I guess I can also deal with this issue, but I thought it would be a good idea to write here :-)

DCM using aa?

Has anyone made a module for running DCM within AA?

Setting the current task in aas_doprocessing_initialisationmodules

(sorry for the long question!)

I'm running a simple recipe using the most recent version of AA4:

<?xml version="1.0" encoding="utf-8"?>
<aap>
    <tasklist>
        <initialisation>
            <module><name>aamod_checkparameters</name></module>
            <module><name>aamod_evaluatesubjectnames</name></module>
            <module><name>aamod_make_subjects_short</name></module>
            <module><name>aamod_autoidentifyseries_timtrio</name></module>
            <module><name>aamod_study_init</name></module>
            <module><name>aamod_newsubj_init</name></module>
        </initialisation>

        <main>                  
            <module><name>aamod_copystructural</name></module>           
        </main>
    </tasklist>
</aap>

and I'm getting this error:

Welcome to aa version 4 on github March 2012
Please wait moment, adding Java objects
Aacc version 2010.08.17
You must compile the utc_time library
 AUTOMATIC ANALYSIS 17-Apr-2012 20:31:52
 =============================================================
 Parallel process ID 932282
 Current aa version 4.00 suitable for this user script

 INITIALISATION MODULE aamod_checkparameters: Check user parameters
 INITIALISATION MODULE aamod_evaluatesubjectnames: Check raw data for subject MRI:CBU110656_MR1/*/*
 INITIALISATION MODULE aamod_make_subjects_short: Make short subject filenames
 INITIALISATION MODULE aamod_autoidentifyseries_timtrio: Automatically identify series numbers for subject MRI:CBU110656_MR1/20110607_093219/Series_001_32_Channel_Localizer

rawdata_allseries =

     1

 Series 1 with 3 dicom files
  Structural series   T maps series     
??? Reference to non-existent field 'currenttask'.

Error in ==> aas_desc_outputs at 17
streamnme=sprintf('stream_%s_outputfrom_%s.txt',streamname,aap.tasklist.currenttask.name);

Error in ==> aamod_autoidentifyseries_timtrio at 209
        aap=aas_desc_outputs(aap,i,'autoidentifyseries',aisfn);

Error in ==> aa_feval at 18
            [a b]=feval(funcname,varargin{:});

Error in ==> aas_doprocessing_initialisationmodules at 23
                [aap,resp]=aa_feval(fullfile(stagepath,stagename),aap,'doit',i);

Error in ==> aa_doprocessing at 146
aap=aas_doprocessing_initialisationmodules(aap);

Error in ==> aa_user_dartelvbm at 41
aa_doprocessing(aap)

I think the key error is "Reference to non-existent field 'currenttask'.". In looking at aas_doprocessing, there is a call that updates the current task for each task (line 224):

aap=aas_setcurrenttask(aap,k);

However, I don't see anything similar in aap_doprocessing_initialisationmodules.

My first thought is that aap_doprocessing_initialisationmodules should be amended to include aas_setcurrenttask. However, surely everyone else would be having this same problem, so I'm assuming I'm missing something obvious. Any help would be appreciated!

Skype discussion

Hi-
I've been thinking it might be good for current active developers to have a chat, to discuss recent developments that each of us have made, and how to make the most of them. As an example, in a development branch I pulled off, I've made some major changes to the parallel system, which I think could be of quite general benefit. I'd also very much like to hear about other developments.

Would you be interested?

All the best
Rhodri

Parallelising aa with torque

I'm interested in parallelising aa by the use of torque, in order to use parallel AA at the DCCN. We can keep track of progress/issues here.

coord2ROI

Have added a little script to create spherical ROIs from coordinates and radii to the extrafunctions folder...

coord2ROI(coord, radius, ROIname, template)

Hope this is ok :-)

aamod_firstlevel_contrasts

The desc_outputs function in aamod_firstlevel_contrasts.m adds both the .img and .hdr files simultaneously, resulting in something like:

spmT_0001.hdr
spmT_0001.img
spmT_0002.img
spmT_0002.hdr

This creates problems down the line in the aamod_secondlevel_model.m, since it selects 1:N (number of contrasts), meaning it considers the same file twice, and mixes up the contrasts, leading to incorrect results.

Garbage collection - priority flags

As suggested by Rhodri, it would be good to enhance garbage collection to allow one to get rid of intermediate processing steps (e.g. DICOMs, raw EPIs, non realigned EPIs, etc.) especially useful for centres with stringent HD space constraints (e.g. DCCN, etc.)

handling external dependencies

What is the best way to handle external dependencies? I'm thinking of scripts and tools that we don't maintain but may want to make use of (and perhaps manage what version aa scripts use).

One way I have seen this handled is to include an "external" directory in which we keep a copy of whatever version of the external software the aa scripts require. For example, I'd like to use Donald McLaren's gPPI toolbox, but if I write an aa module to use it, then any other aa user would need to download the toolbox on their own (and hopefully get the same version I tested my script on), otherwise the aa module will fail (perhaps without a helpful warning).

Presumably, with this sort of setup, we would want to have a flag (which may be optional?) to recursively include all of the subdirectories in the "external" folder in the Matlab path for an aa analysis - in other words, leave the user the option of using a local (non-bundled) version of the software if they want, but perhaps defaulting to using the bundled (and thus hopefully known-to-work!) version.

I was thinking about this mostly in terms of non-SPM software, but in fact, it could possibly extend to include SPM. That would prevent new releases of SPM from breaking AA (because the version of SPM distributed with AA would always be tested). (This part may be unnecessary, but for other toolboxes I think some principle organization would be helpful.)

sliceorder stream missing

Dear AAers -

I am trying to run a recipe for 1st-level fMRI preprocessing and stats, which looks identical to the default recipe provided with aa4 "aap_tasklist_fmri_noslicetiming_cbu32channel_withmodel.xml" (apart from an alias I added for 2 different models), but get the error below. (The same script works fine in aa3). If I don't want to do slice-time correction, how do I specify a sliceorder stream?

Thanks
Rik

You must compile the utc_time library
AUTOMATIC ANALYSIS 31-Jul-2012 13:35:15

Parallel process ID 814724
Current aa version 4.00 suitable for this user script

INITIALISATION MODULE aamod_checkparameters: Check user parameters
INITIALISATION MODULE aamod_evaluatesubjectnames: Check raw data for subject MRI:CBU120645__/_
INITIALISATION MODULE aamod_study_init: aa initialise study
INITIALISATION MODULE aamod_newsubj_init: Create subject directory for subject MRI:CBU120645_MR10040_CC100012/20120612_113305
Stage aamod_get_dicom_structural input autoidentifyseries comes from aamod_autoidentifyseries_timtrio which is 1 dependencies prior
Stage aamod_get_dicom_epi input autoidentifyseries comes from aamod_autoidentifyseries_timtrio which is 2 dependencies prior
Stage aamod_copystructural input dicom_structural comes from aamod_get_dicom_structural which is 2 dependencies prior
Stage aamod_convert_epis input dicom_epi comes from aamod_get_dicom_epi which is 2 dependencies prior
Stage aamod_realign input epi comes from aamod_convert_epis which is 1 dependencies prior
Stage aamod_tsdiffana input epi comes from aamod_realign which is 1 dependencies prior
Stage aamod_coreg_noss input meanepi comes from aamod_realign which is 2 dependencies prior
Stage aamod_coreg_noss input structural comes from aamod_copystructural which is 4 dependencies prior
Stage aamod_norm_noss_cbu32channel input structural comes from aamod_coreg_noss which is 1 dependencies prior
Stage aamod_norm_write_meanepi input normalisation_seg_sn comes from aamod_norm_noss_cbu32channel which is 1 dependencies prior
Stage aamod_norm_write_meanepi input meanepi comes from aamod_realign which is 4 dependencies prior
Stage aamod_norm_write input normalisation_seg_sn comes from aamod_norm_noss_cbu32channel which is 2 dependencies prior
Stage aamod_norm_write input epi comes from aamod_realign which is 5 dependencies prior
Stage aamod_smooth input epi comes from aamod_norm_write which is 1 dependencies prior
Stage aamod_firstlevel_model_RTdur input epi comes from aamod_smooth which is 1 dependencies prior
Stage aamod_firstlevel_model_RTdur input epi_header comes from aamod_convert_epis which is 8 dependencies prior

**** automatic analysis failed - see reason and line numbers below
Stage aamod_firstlevel_model_RTdur required input sliceorder is not an output of any stage it is dependent on. You might need to add an aas_addinitialstream command or get the stream from a remote source.
for help, see the aa wiki
??? Error using ==> aas_log at 57
aa error

Error in ==> aas_findinputstreamsources at 51
aas_log(aap,true,sprintf('Stage %s required input %s is not an output of any stage it is dependent on. You
might need to add an aas_addinitialstream command or get the stream from
Error in ==> aa_doprocessing at 159
aap=aas_findinputstreamsources(aap);

Update on AA parallel processing

What are the current options for parallel processing? I've looked at:

https://github.com/rhodricusack/automaticanalysis/wiki/Parallel

but am still a little confused.

aap.options.wheretoprocess would seem to accept:

  • localsingle
  • localparallel
  • condor
  • qsub
  • aws

from aa_doprocessing.m around line 181.

However, I only have aaq_localsingle, aaq_condor, and aaq_sub functions.

(The practical matter is I'm running an AA4 analysis on the CBU cluster, and was hoping for, at least, oldschool AA3-style parallel processing...)

meanepi stream and sessions...

I have been having some trouble with the meanepi stream at various points, since calling it requires calling the first session. Is there any particular need for this, or could it be changed so that meanepi is a subject level stream?

double checking my understanding of aas_desc_outputs

I've been belatedly coming to terms with how AA4 handles streams, and specifically inputs and outputs. I wanted to just make sure of one minor detail regarding stream description.

My understanding is that aas_desc_outputs updates aap with the appropriate files and descriptions. However, in some example files, there is no output to the function call. E.g. in aamod_slicetiming.m, line 68 is:

aas_desc_outputs(aap,i,j,'epi',rimgs);

where I would have expected:

aap = aas_desc_outputs(aap,i,j,'epi',rimgs);

Am I missing something? Does aas_desc_outputs do anything useful without an output aap?

Unexpected interactions: bug in mri_findvol

The variable aap.acq_details.subjects{}.mriname value was being modified when running aamod_evaluatesubjectnames. The name of one of the files in [rawdata]/[subj]/ was being appended to mriname, which I discovered when running aamod_epifromnifti on my local filesystem (though this may affect other modules).

I tracked down the problem to mri_findvol, which has a logical bug:
It uses the results of dir(fullfile(SEARCHPATH{i},subjpath,'*')), presumably to determine if the subject directory exists.

This introduces a bug if you have:
/path/to/subject1
/path/to/subject10
/path/to/subject12
... because dir('/path/to/subject1*') is going to return all three of these directories.

And as mentioned above, this approach also resulted in the creation of a superfluous sub-directory under each subject, with the name of the last file returned by the dir statement:
/path/to/mod_epifromnifti_stream/subject1/C.nii/A.nii
/path/to/mod_epifromnifti_stream/subject1/C.nii/B.nii
...
/path/to/mod_epifromnifti_stream/subject1/C.nii/Z.nii

This stems from the last few lines of the function, which sets
strSubjDir = dir(fullfile(SEARCHPATH{i},strSubj.name))
and then sets
strSubj = strSubjDir(3).name (either with or without the path)

I wasn't totally clear what the intended output of the function was supposed to be, so I wasn't sure how to proceed with a bugfix for mri_findvol(), though I have a fix in place for aamod_evaluatesubjectnames.m, which uses fileparts() to strip the filename from strSubj, thereby eliminating the superfluous directory creation problem I was experiencing.

HBM poster planning

Given that HBM is a little over a month away, and Rhodri will have a poster on AA, would it be worth visiting what are the key things that we want to have done by then?

I will get the SPM8 VBM/DARTEL pipeline ready. Rhodri, what else were you hoping to show off?

Also, if there's a chance other people are going to be downloading and trying, perhaps we should aim for tagging a stable release prior to HBM that contains a minimum of experimental or nonworking code, which we can point people to?

(I have to admit that I'm not sure how release/version tagging works in git - I think it's simple, but this seems like it might be a good time to sort it out.)

tasksettings vs. tasklist?

My impression is that xml files used to use tasksettings, and now use tasklist. e.g.

<?xml version="1.0" encoding="utf-8"?>
<aap>
    <tasklist>
        <currenttask domain='session' desc='Convert EPIs'>

        blah

       </currenttask>
   </tasklist>
</aap>

And that currently using tasksettings produces an error (but tasklist works). Is that correct?

If so, is there any downside to me updating xml header files to all use tasklist then?

Change to rawdatadir

Hi Tibor-
You've changed the syntax for rawdatadir to include an extra level - rawdatadir.paths.
This syntax is going to generate frequent problems, as people frequently set rawdatadir (at least outside the CBU). It will render lots and lots of user scripts incompatible. When we make changes, can we try to find ways to make them backwards compatible?
Rhodri

stream naming: "structural" -> "T1" ?

Given the possibility of more than one type of structural image, would it make sense to be more specific with regard to structural images? e.g. T1, T2, DT...?

One clear use case is for CamCAN, in which we may want to use both T1 and T2 images in tissue class segmentation - I'm not sure how that would work now with the 'structural' stream as an input.

Any thoughts?

optional output streams?

What is the best way to handle modules which have several options for output streams, only a subset of which may be wanted by the user?

For example, when doing segmentation, for each tissue class (of which there are 6 in New Segment), these can be written out in native space, normalized space (modulated), and normalized space (unmodulated). Similarly, bias fields, the bias corrected image, and deformation fields can all be written out (but are seldom used).

Is it better to write everything out all the time, and then files that aren't needed can later be deleted through garbage collection? To me this seems the only way to make sure that the output streams set in the xml header are always accurate.

The other approach would be to let users request what output images they want (because fewer images would save a bit of time and a bit of disk space), and adjust the output descriptions accordingly, but I don't see a clear way to make this work.

Regarding indices used for subjects & sessions

I noticed that we often use the i and j indices for subjects and sessions, but these are used for matlab as imaginary number representations. If we use these indices, it becomes more difficult to do things with imaginary numbers, such as when we consider magnitude and phase EPI images. Should we attempt to use other indices, such as p (participants) and s (sessions) instead in future?

(user) mailing list?

I think it would be helpful to start a mailing list for users - i.e. github issues are great for us all to discuss things, but I think are probably best suited to internal discussions/planning as opposed to a help list.

I don't know of any good alternatives other than google groups.

I'm happy to set this up if that would help, but am also happy if others want to or have other ideas? I would probably call the group automaticanalysis to match the github name. Alternatively, something like aa-discuss (because aa is easier to type than automatic analysis), which would also give us the option of a partner aa-announce simply for announcing releases and bugfixes, etc.

[~ , stuff] = syntax

The syntax:
[~, stuff]=myfunction(otherstuff)
which throws away the first parameter is very elegant, but unfortunately, only supported in very recent matlabs. This is creating problems on people that run older releases. I suggest we avoid it, and stick to the less elegant:
[junk, stuff]=...
for now...

Document existing modules

I think we should eventually make sure that all modules are documented and have a concise but comprehensive help blurb. What do you think?

First level model

We seem to marching to different drumbeats a little in aamod_firstlevel_model, and there are some important bugs creeping in. Of particular concern are some old friends

SPM.xBF.T
SPM.xBF.T0

Lets rehearse what we know, and the lovely ways to screw these up.

T is the number of 'microtime bins' that SPM uses in its modelling - how finely it subsamples time when doing its convolution. The default is 16, and I don't know a good reason for changing this.

T0 is the microtime bin number that the model you've specified should be dropped down at. Lets consider some situations:
(1) You're doing slice timing - all of the aamod_firstlevel_model scripts I know of then adjust appropriately, by reading the sliceorder stream. Check the "sliceorder" is one of the input streams in your .xml file.
(2) You're not doing slice timing, and are using a regular EPI sequence. You probably want to line up with the middle bin in your cycle (e.g., SPM.xBF.T0=8 when SPM.xBF.T0=16).
(3) You're not doing slice timing, and are using a sparse EPI sequence. You probably want to line up with the middle of your sparse acquisition (e.g., for 2s acquisition followed by 2s gap, put SPM.xBF.T0=4 when SPM.xBF.T=16, which is 25% of the way.

PITFALLS WE MAY NEED TO FIX
(1) Things you shouldn't do are:
SPM.xBF.T0=0
@annikalinke and @conorwild discovered this gives a completely unintended behaviour. Use SPM.xBF.T0=1 if you want to put the acquisition at the first bin.
I think this affects @alexvicegrab's versions of this code

(2) Be careful of
SPM.xBF.T=numel(sliceorder);
in @tiborauer's versions of the code if you then fix SPM.xBF.T0: adjust T0 or clobber T appropriately.

Any other thoughts?

Merging MVPaa with aa proper?

One of the last things I was considering is, because my MVPaa toolbox is small and requires aa, I thought perhaps we could merge its stable version into this github. I could then branch the entire thing and continue developing any extra, non-stable features.
Does that sound like a reasonable idea?

aamod_secondlevel_model (automatic contrast definition)

Not as much an issue as a gentle (non-urgent) request:

It would be great if the contrasts did not need to be calculated manually after doing the second level model analysis via SPM, but were already done automatically by aa.

i.e. after clicking on results, there are no contrasts defined, and one needs to define a positive (and negative) contrast manually before viewing.

aamod_epifromnifti problems

Hello, the aamod_epifromnifti did not work, so I've implemented the following code to fix it. Have not yet tested it thoroughly, but it seems to do the trick for me.

The main places it broke are where it expects that the images are located within the subject folder, so I added a function to copy the files to the aamod_epifromnifti (subject-specific) folder.
Also where there are multiple 3D images, it previously wanted to fullfile the images, but I did not manage to get the fullfile to work on cells or strvcat arrays, so I modified it to instead expect the full path to each image be specified by the user in an array of cells.

Does this make sense?

I can't yet update the git, since I need the tech team here to set up git on our servers, but will try do it from my mac if you agree this is a valid fix :-)


allfn={};
if (iscell(aap.acq_details.subjects(i).seriesnumbers{j}))
% lots of files 3D
% [AVG] we cannot cocatenate the single root with
% multiple 3D image files, so it expects already the
% full location of the 3D images instead...
try
imageFns = aap.acq_details.subjects(i).seriesnumbers{j}{:};
catch
imageFns = aap.acq_details.subjects(i).seriesnumbers{j};
end

            subjPath = aas_getsubjpath(aap,i);

            if ~exist(fullfile(subjPath, aap.acq_details.sessions(j).name), 'dir')
                mkdir(fullfile(subjPath, aap.acq_details.sessions(j).name));
            end

            for f = 1:length(imageFns)
                % [AVG] Expects a cell array of images at the moment
                [root, fn, ext] = fileparts(imageFns{f});
                % [AVG] Copy file to module location
                unix(['cp ' imageFns{f} ' ' fullfile(subjPath, aap.acq_details.sessions(j).name, [fn ext])]);
                % [AVG] Add file to what will be described as output...
                allfn = [allfn fullfile(subjPath, aap.acq_details.sessions(j).name, [fn ext])];
            end

Deprecated code?

Hello, I've noticed some functions that may not be used (anymore) and could be deleted from the master...
I have deleted the following from my branch on the first pass of my dependency analysis. What do you think?

aa_feval2
aa_parallel_status
aa_parallelmonitor
aas_getboredworker
aas_getboredworker2
aas_getstudypath_old
aas_getworkerdescription
aas_getworkerpid
aas_parsepvshow
aaworker_*
aas_launchworker
aas_updateworkerstatus

also, there's some functions that appear to do the same thing:
aas_clear_aapq & aas_clear_jobq

Should there ever be a need to do file filtering on a stream contents?

I had imagined that a stream would uniquely identify all, and only, the files of a particular kind. So, the "structural" (or soon to be "T1") stream would only contain normalized images after normalization, and so on.

However, for the purpose of setting up bet, Sasha added the following into the structural stream during aamod_norm_noss:

  • unnormalized structural
  • bias corrected structural image (mm*)
  • warped structural image (w*)

Now, he and I agreed that there's no need to have the unnormalized, because if one wants, one can use the fully specified syntax in a tasklist or .xml module wrapper
aamod_copystructural.structural
to get to the previous data. So, we took this out.

However, now I'm running into a problem that the aamod_bet_modified module filters for the "mm" image, rather than taking the "w, which is what I want to run it on. By re-including file filtering within the aamod_bet_modified module, we've made it more difficult to change what a module works on by just changing its order. If you want bet to run on the data before normalization, then you put it before norm_noss; if you want it after, you put it afterwards.

I would suggest that we try to avoid file filtering for this reason. We could either write a separate bias correction module before normalization, or write this to a separate stream (T1_biascorr or something)?

Fix for aamod_firstlevel_model_MVPaa

This module would break if selected sessions did not start with 1...

Fixed by changing line 234 from:

sessRegs = 1:size(model{1}.event,2);

to

sessRegs = 1:size(model{aap.acq_details.selected_sessions(1)}.event,2);


Will update once I've tested this fixes everything + have set up git on my machine :-)

More flexible inputstream handling

At the moment there is no way for the user to disable/enable particular inputstreams for a module. For example, aamod_firstlevel_model looks for the sliceorder stream but this only exists if you've done slicetime correction. Sasha suggested that you can get around this by creating a custom XML file for the module that doesn't include this, but this is a bit hacky.

Would it be difficult to allow the user to manually override the inputstream setting for a particular module in the tasklist / user script? At the moment this doesn't seem to work.

devel-share: aamod_slicetiming - input .txt file not found

Running aamod_slicetiming_nodicom on 2 functional runs, I find that slice timing is performed on the first run, but when the second run is attempted, I get:

/path/to/run_2/stream_epi_inputto_aamod_slicetiming_nodicom_00001.txt not found

Sure enough, the run1 directory has this text file, but the run2 directory has only aap_parameters_aamod_slicetiming_nodicom_00001.mat.

TR

I think it's a bit messy how the TR is determined repeatedly during pre-processing and modeling. Also, the current version of the first level model script will actually - but easily fixable - crash if the TR is manually set in its task settings. I know we don't normally want to mess with the TR extracted from the dicomheaders but in sequences where the TR is set by slice and not volume we have to. It's also a little distressing to see the by-slice TR printed out in the matlab command window during series conversion, although I do agree that's generally a good feature and it will be a rare occasion that the dicomheaders have not saved the volume TR. Anyway, should we clean it up a little?

domain of stream

Hi all,

I am running some code that needs aas_addinitialstream. For this to properly run I need to know whether the domain of an output stream is study, subject or session specific. Is there a straightforward way to find this out?

Best,

Ben

<stream ismodified="0"> bug

I'm just making a note of this so I can go back and fix it at another time, but I noticed that if you have an input stream with the ismodified="0" attribute, then any streams listed after that one in the .xml aren't recognized (i.e., the won't copy over when the module starts)

Expand aa modules to run studies without DICOMs

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.

Selected sessions - move out of branch

As discussed with Rhodri, current way of selecting sessions can create problems if we don't really want branching, but to do a subset of analyses on one dataset (e.g. Make a localiser ROI based on a pair of runs) and apply it on another (ROI analysis). It would be good to eventually move selected sessions out of branches and into the modules.

spikes and moves

We used to have code that inserted nuisance regressors into the first level model, to take out scans near large changes in global signal, or big movements. This used aamod_listspikes (which is in the codebase, but hasn't been updated to aa_ver4) and extra code in aamod_firstlevel_model (which looks to be missing).

Shall we put this back in? Does anyone have newer versions of the relevant code?

branching and releases

Although it's more complicated than we need, this seems like a good branching model:

http://nvie.com/posts/a-successful-git-branching-model/

The main idea that appeals to me is that the master branch always "works", and new ideas are added elsewhere. This allows easy tagging of master releases that don't incorporate new and untested things.

I suggest we start to follow this model with a baby step of adding a "develop" branch (which I've just added). The idea would be to treat the develop branch the way we currently treat the master (i.e. what we're probably working on on a daily basis), and just merge things over to the master branch when we know they're working.

With an eye to HBM, this will also let us start removing things from the master branch that aren't quite ready for sharing (but we can leave them in the develop branch).

Thoughts?

Dependency problems in share-devel

When I run aamod_slicetiming after aamod_realign the dependency manager loads all of the sessions (not just the current session).

The deps cell array has domain session, subject, session, session, session for these "5" streams (it loads the first session of my 4 twice)

It looks as if there is a bug in the dependency tree code, but I've not managed to find what is wrong, and don't want to break something. Could someone check/confirm this bug?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.