SIMEXP / niak

GNU Octave library for connectivity analysis in large fMRI datasets
http://niak.simexp-lab.org
Other
28 stars 21 forks source link

Errors running NIAK pre-processing pipeline #376

Closed amrithah closed 6 years ago

amrithah commented 6 years ago

Hello,

I am trying to run the NIAK pre-processing pipeline on one subject to test, before running it on all of the others for my master's thesis. However, I want to make sure the first few lines are correct, since it keeps giving errors such as the following:

error: syntax: PIPELINE = NIAK_PIPELINE_FMRI_PREPROCESS(FILES_IN,OPT).
 Type 'help niak_pipeline_fmri_preprocess' for more info.
error: 'sub_check_format' undefined near line 2 column 12
error: 'opt' undefined near line 2 column 21
error: 'opt' undefined near line 1 column 28
error: 'opt' undefined near line 1 column 33

This is my first time working with the code, so I may have inadvertently typed something wrong. I think it isn't recognizing how I wrote the paths for the subjects, but I wanted some additional input from someone to confirm. Here is the first few lines of what I have, followed by the script I pulled off of the GitHub for the niak_pipeline_fmri_preprocess.m file:

function [pipeline,opt] = niak_pipeline_fmri_preprocess(files_in,opt)
path_data = [pwd filesep];
% Structural scan subject 1
files_in.subject1.anat = ...
    [path_data '/Users/amrithah/Desktop/NYU_A/0050952/session_1/anat_1/mprage.nii.gz'];       
% fMRI run 1 subject 1
files_in.subject1.fmri.session1.rest = ...
    [path_data '/Users/amrithah/Desktop/NYU_A/0050952/session_1/rest_1/rest.nii.gz'];

Any help would be greatly appreciated, thanks!

pbellec commented 6 years ago

hi @amrithah

The first line function [pipeline,opt] = niak_pipeline_fmri_preprocess(files_in,opt) shouldn't be there.

Please check https://nbviewer.jupyter.org/github/SIMEXP/niak_tutorials/blob/master/niak_tutorial_fmri_preprocessing.ipynb if you haven't already.

amrithah commented 6 years ago

Thanks, I'll double check that again for reference.

amrithah commented 6 years ago

I also wanted to confirm with you - should I be following the wiki, or what's written in the demo script? For example, the wiki states:

% Number of dummy scans to suppress. % Dummy scans are the first volumes of an fMRI run, when the signal values have not yet stabilized % Modern scanners typically discard the dummy scans automatically % but older datasets may require the user to manually eliminate them opt.slice_timing.suppress_vol = 0;

However, the demo script which I have been modifying as per the wiki states opt.slice_timing.suppress_vol = 0; to be at 3. Which advice is correct?

Also, is there a difference between the demo and fmri_preprocess.m files? When I try to run the main fmri_preprocess.m file, it gives the errors I had stated here. But, the demo works just fine so I'm not sure which one is more advisable to run.

pbellec commented 6 years ago

As the comment states, it depends if the scanner auto suppresses these scans.

In doubt, eliminate about 10 seconds of signal, which is 3-5 volumes (depend on TR), or much more with multiband imaging.

Also thanks for noting the discrepancy between the pipeline documentation and the tutorial.

pbellec commented 6 years ago

BTW have you resolved you original issue? If yes I will close it.

pbellec commented 6 years ago

BTW2 I have fixed the documentation of the pipeline to provide more explanations, and use a parameter consistent with the tutorial.

amrithah commented 6 years ago

No, I am still having those errors show up even after I removed:

function [pipeline,opt] = niak_pipeline_fmri_preprocess(files_in,opt) I tried to edit the niak_demo script, and went through the wiki line by line to add necessary parameters. However, I suspect the niak_demo script doesn't include all of the pipeline parameters needed to run a full pre-processing pipeline. Which is why I wanted to clarify the differences, because I still have the above issue with the main fmri_preprocessing.m script.

pbellec commented 6 years ago

I am not sure what niak_demo you are referring to.

This is the tutorial https://nbviewer.jupyter.org/github/SIMEXP/niak_tutorials/blob/master/niak_tutorial_fmri_preprocessing.ipynb

Also available as a script https://raw.githubusercontent.com/SIMEXP/niak_tutorials/master/niak_tutorial_fmri_preprocessing.m

If you get an error running that into the niak container, please post the error message.

amrithah commented 6 years ago

Sorry for the confusion, the demo script was in reference to the niak_tutorial_fmri_preprocessing script. I have successfully gotten the tutorial script to work, but I get the opt_out errors for the niak_pipeline_fmri_preprocess.m script. They are two different scripts from what I see, the latter being the full pre-processing pipeline, right?

Which one should we be using, and I guess my question is why is the niak_pipeline_fmri_preprocess.m showing these errors when it worked for the tutorial script?

pbellec commented 6 years ago

Still not 100% sure I understand.

The function niak_pipeline_fmri_preprocess is not meant to be edited. It is generic code.

You need to modify the tutorial itself, changing the path for your own data, and changing the parameters to reflect the characteristics of your data and the type of preprocessing you would like to do.

I hope this helps.

amrithah commented 6 years ago

That makes more sense, and that's what I've been doing. My question above was referring to the attached screenshot:

What is the niak_pipeline_fmri_preprocess.m script? It's under this link:https://github.com/SIMEXP/niak/tree/master/pipeline

I was getting confused, because the tutorial script works, but this script does not (and gives the error I opened on this thread). So you're saying ignore this script, and use the tutorial script? Does no one use the niak_pipeline_fmri_preprocess.m script anymore? I was under the impression that's the main pipeline script, and the tutorial is to test before you use the niak_pipeline_fmri_preprocess.m script.

screen shot 2017-12-12 at 10 50 43 am

pbellec commented 6 years ago

The last line in the tutorial calls niak_pipeline_fmri_preprocess.

When you say the tutorial works, does this include this line?

amrithah commented 6 years ago

Yes, everything in the tutorial works, including that line. Oh, I think I understand what my confusion is. Is everything in https://github.com/SIMEXP/niak/tree/master/pipeline parts of the pipeline bundled into a folder? I thought that was the actual pre-processing script. Sorry about any confusion, I didn't realize that! I think we're good. I just had misunderstood, and was running that matlab file thinking it was the pre-processing script. Thanks for clarifying!

33902602-60a5e738-df2a-11e7-8cdd-62dae7e585e7

pbellec commented 6 years ago

Absolutely, you need to adapt the tutorial to your data, which includes a call to niak_pipeline_fmri_preprocess. The code you located is indeed what is used. You don't need to edit these files though, just change the variables files_in and opt in the tutorial.

amrithah commented 6 years ago

Got it. I was running that individual matlab file which was throwing back the error, thinking that was the only pre-processing script. Thank you so much for being patient with me!