open-discussion > slomoco with pestica4
Showing 1-6 of 6 posts
Display:
Results per page:
Jul 18, 2016  02:07 PM | Christian Kaufmann
slomoco with pestica4
Hi,

I installed pestica4 on a Mac (10.11) with Matlab 2015b and afni (Precompiled binary macosx_10.7_Intel_64: Jul 8 2016 (Version AFNI_16.2.01)). After some troubleshooting (due to some ugly OS X and Matlab interaction) pestica4 did run successfully after starting it with 
run_pestica.sh -d epiFile

Now I'd like to run 
slicemoco_newalgorithm.sh –d epiFile -r

The question now seems to be a basic one. It won't start but just gives back when starting within the folder where the epiFile (= OutBrick_run_025+orig.BRIK OutBrick_run_025+orig.HEAD) lives:

### output from shell:
slicemoco_newalgorithm.sh –d OutBrick_run_025+orig -r
Note that the physiologic fluctuation will not be regressed out (not recommended)
3D+time EPI dataset must be given
slicemoco_newalgorithm (distributed with PESTICA v4)
Algorithm: this script first runs slicewise in-plane (xy) 3DOF motion correction
then runs a slicewise 6DOF rigid-body correction for each slice
this script reads these motion parameters back in and regress on voxel timeseries
WARNING, make sure you have removed unsaturated images at start (such as first 4 vols)
You can test first volumes for spin saturation with: 3dToutcount | 1dplot -stdin -one
Is the first volume much higher than rest? If so, you may need to remove first several volumes first
If you don't know what this means, consult someone who does know, this is very important,
regression corrections (and analyses) perform poorly when the data has unsaturated volumes at the start
Simple method to remove 1st 4: 3dcalc -a "+orig[4..$]" -expr a -prefix .steadystate

Usage: slicemoco_newalgorithm.sh -d
-d = dataset: is the file prefix of
the 3D+time dataset to use and correct.
Note: this script will detect suffix for epi_filename
slicemoco_newalgorithm.sh -d -r
-r = perform in parallel with final PESTICA regression correction
this assumes PESTICA estimation steps 1-5 have been run and exist in subdir pestica4/
slicemoco_newalgorithm.sh -d -p
-p = same as -r option, but assuming you used PMU data instead of PESTICA for the correction
Recommended, run after running PESTICA or PMU correction, so we can incorporate all regressions in parallel:
slicemoco_newalgorithm.sh -d -r
OR, slicemoco_newalgorithm.sh -d -p
###

That is, slicemoco does not seem to recognize the epiFile. I did try including the absolute path which didn't change the output. Any idea?

An additional and unrelated question: Is it possible to explicitly feed in slice timing info in ms for each slice within the pestica4 pipeline, especially when using nifti files (because after converting DICOMs slice timing information gets lost)?

Thank you for your great tools!

Christian
Jul 18, 2016  11:07 PM | Wanyong Shin - Cleveland Clinic Founcatoin
RE: slomoco with pestica4
Hi, Christian.

Try with slicemoco_newalgorithm.sh –d OutBrick_run_025 -r

In case of SMS (MB) acquisition, I generated ms unit of slice timing info file, e.g. slicetiming.1D and injected it with AFNI to3d command, e.g. to3d -time:zt xx xx xx @silcetiming.1D -prefix xxx

Hope it works

-Wanyong
Jul 20, 2016  07:07 AM | Christian Kaufmann
RE: slomoco with pestica4
Hi Wanyong,

I tried different things which I didn't mention in my previous comment ;-) I also tried 
slicemoco_newalgorithm.sh –d OutBrick_run_025 -r
but with no luck so far (the same behavior as mentioned above). 

I also tried it on another system (Ubuntu 14.4 LTS, updated AFNI) but had no luck either.

As it works with your setup and slicemoco_newalgorithm.sh repeatedly tells me "3D+time EPI dataset must be given" I suspect an installation issue on my side. 

Thanks so much, Christian
Sep 22, 2016  09:09 PM | Christian Kaufmann
RE: slomoco with pestica4
Finally, after upgrading to AFNI 16.2.17, slicemoco_newalgorithm.sh -d epiFile -r worked with my setup (Ubuntu 14.04 LTS, Matlab R2012b). Thank you for your help so far!

However, I encountered another issue while running second order moco (whole error output below).

You might have an idea what's going wrong especially where it reads:

===
Error in convert_1dmat_into_tranmatarray (line 3)
[zdim tdim veclen] = size(transmat1d_zt);
Output argument "tranmat_zt" (and maybe others) not assigned during call to
"/mrt/Applications/pestica4/slomoco/convert_1dmat_into_tranmatarray.m>convert_1dmat_into_tranmatarray".
Error in slicemoco_newalgorithm_input (line 25)
tranmat_zt = convert_1dmat_into_tranmatarray(transmat1d_zt);% tranmat_zt =
reshape(tranmat_zt,[zmbdim tdim 3 4]); % (v1) debugged
===

Thank you!

Christian





Whole error output during "slicemoco_newalgorithm.sh -d epiFile -r:
===
finished slicewise in-plane motion correction
Exiting

Running Secondorder Motion Correction using SLOMOCO output
cp ../pestica4/card_pestica4.dat card_pestica4.dat
cp ../pestica4/resp_pestica4.dat resp_pestica4.dat
matlab -nojvm -nosplash addpath /mrt/Applications/pestica4/slomoco; addpath /mrt/Applications/pestica4/afni_matlab; addpath /mrt/Applications/pestica4/pestica_matlab; CARD=load('card_pestica4.dat'); RESP=load('resp_pestica4.dat'); slicemoco_newalgorithm_input('OutBrick_run_022.slicemocoxy_afni+orig','OutBrick_run_022.brain+orig','tempslmoco_volslc_alg_vol_OutBrick_run_022.slicemocoxy_afni/motion.wholevol_zt',CARD,RESP); exit;

< M A T L A B (R) >
Copyright 1984-2012 The MathWorks, Inc.
R2012b (8.0.0.783) 64-bit (glnxa64)
August 22, 2012
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit http://www.mathworks.com.

>> Note: SMS acquisition is applied (MB acc. fac = 6).
Error in convert_1dmat_into_tranmatarray (line 3)
[zdim tdim veclen] = size(transmat1d_zt);
Output argument "tranmat_zt" (and maybe others) not assigned during call to
"/mrt/Applications/pestica4/slomoco/convert_1dmat_into_tranmatarray.m>convert_1dmat_into_tranmatarray".
Error in slicemoco_newalgorithm_input (line 25)
tranmat_zt = convert_1dmat_into_tranmatarray(transmat1d_zt);% tranmat_zt =
reshape(tranmat_zt,[zmbdim tdim 3 4]); % (v1) debugged
>> matlab -nojvm -nosplash addpath /mrt/Applications/pestica4/slomoco; addpath /mrt/Applications/pestica4/pestica_matlab; addpath /mrt/Applications/pestica4/afni_matlab; qa_slomoco('OutBrick_run_022.slicemocoxy_afni+orig','tempslmoco_volslc_alg_vol_OutBrick_run_022.slicemocoxy_afni/motion.wholevol_zt','tempslmocoxy_afni_OutBrick_run_022'); exit;

< M A T L A B (R) >
Copyright 1984-2012 The MathWorks, Inc.
R2012b (8.0.0.783) 64-bit (glnxa64)
August 22, 2012
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit http://www.mathworks.com.

>> Note: SMS acquisition is applied (MB acc. fac = 6).
Index exceeds matrix dimensions.
Error in qa_slomoco (line 61)
outofplane(acqtp,:) = rotmat_zt(z,t,:); % [tdim*zmbdim [dL dP dS
rotmatvector (1:9)]]
>> *+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./OutBrick_run_022+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./OutBrick_run_022+orig.BRIK is 4.199786 degrees from plumb.
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./OutBrick_run_022+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./OutBrick_run_022+orig.BRIK is 4.199786 degrees from plumb.
*+ WARNING: If you are performing spatial transformations on an oblique dset,
such as ./OutBrick_run_022+orig.BRIK,
or viewing/combining it with volumes of differing obliquity,
you should consider running:
3dWarp -deoblique
on this and other oblique datasets in the same session.
See 3dWarp -help for details.
++ Oblique dataset:./OutBrick_run_022+orig.BRIK is 4.199786 degrees from plumb.
3drefit -saveatr -atrint TAXIS_NUMS 350 72 77002 -999 -999 -999 -999 -999 OutBrick_run_022.slicemocoxy_afni.slomoco_pestica+orig
++ 3drefit: AFNI version=AFNI_16.2.17 (Sep 16 2016) [64-bit]
++ Authored by: RW Cox
** ERROR: Can't open dataset OutBrick_run_022.slicemocoxy_afni.slomoco_pestica+orig
++ 3drefit processed 0 datasets
3drefit -saveatr -atrfloat TAXIS_FLOATS 0 1.05 0 -31.762 2 -999999 -999999 -999999 OutBrick_run_022.slicemocoxy_afni.slomoco_pestica+orig
++ 3drefit: AFNI version=AFNI_16.2.17 (Sep 16 2016) [64-bit]
++ Authored by: RW Cox
** ERROR: Can't open dataset OutBrick_run_022.slicemocoxy_afni.slomoco_pestica+orig
++ 3drefit processed 0 datasets
3drefit -saveatr -atrfloat TAXIS_OFFSETS 0 0.44 0.8775 0.265 0.7025 0.0875 0.5275 0.9675 0.3525 0.79 0.175 0.615 0 0.44 0.8775 0.265 0.7025 0.0875 0.5275 0.9675 0.3525 0.79 0.175 0.615 0 0.44 0.8775 0.265 0.7025 0.0875 0.5275 0.9675 0.3525 0.79 0.175 0.615 0 0.44 0.8775 0.265 0.7025 0.0875 0.5275 0.9675 0.3525 0.79 0.175 0.615 0 0.44 0.8775 0.265 0.7025 0.0875 0.5275 0.9675 0.3525 0.79 0.175 0.615 0 0.44 0.8775 0.265 0.7025 0.0875 0.5275 0.9675 0.3525 0.79 0.175 0.615 OutBrick_run_022.slicemocoxy_afni.slomoco_pestica+orig
++ 3drefit: AFNI version=AFNI_16.2.17 (Sep 16 2016) [64-bit]
++ Authored by: RW Cox
** ERROR: Can't open dataset OutBrick_run_022.slicemocoxy_afni.slomoco_pestica+orig
++ 3drefit processed 0 datasets
3dNotes -h slicewise_moco_inplane.sh OutBrick_run_022+orig OutBrick_run_022.slicemocoxy_afni.slomoco_pestica+orig
Error: Cannot open dataset
===
Oct 31, 2016  03:10 PM | Wanyong Shin - Cleveland Clinic Founcatoin
RE: slomoco with pestica4
Hi, Crhistian
Sorry for the delayed respone.
Please delete pestica4 directory and re-run it. Sometimes it works.
Pelase let me know if it works.

Wanyong
Nov 4, 2016  06:11 PM | Christian Kaufmann
RE: slomoco with pestica4
Dear Wanyong,

thanks for your help! I found that one issue relates to the Nifti file format where slice acquisition timing is not included in the nii file. I have prepared an EPI time series for download in AFNI file format as well as in Nifti file format. Perhaps you may find time to have a look at the data? Here is the link for download (it is a data sharing tool from within the university and save).

Thank you, Christian


https://www3.hu-berlin.de/dateiaustausch...