open-discussion > Regress CSF/White Matter mean
Showing 1-6 of 6 posts
Display:
Results per page:
Jul 27, 2017  12:07 PM | Meiling Li
Regress CSF/White Matter mean
Hello,
I am doing fMRI preprocessing and calculating seed-to-voxel functional connectivity using BioImageSuite. I encountered errors when i regress CSF/White Matter mean, please help me to check these errors.

invalid command name "0"
invalid command name "0"
while executing
"$whitecsfmask Save $tmpname2"
(object "::bis_fmri0" method "::bis_fmrisetup::ComputeSeedCorrelation" body line 58)
invoked from within
"::bis_fmri0 ComputeSeedCorrelation 0 1 1 "
invoked from within
".pxtclobj1.main.1.c.1.canvas.notebook.cs.page6.cs.output2.childsite.top.1 invoke"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list $w invoke]"
(procedure "tk::ButtonUp" line 22)
invoked from within
"tk::ButtonUp .pxtclobj1.main.1.c.1.canvas.notebook.cs.page6.cs.output2.childsite.top.1"
(command bound to event)

The information shown on the terminal screen was:
we are doing csf correction individually
Loaded voi image from /Templates/GreyWhiteCSF_mask_91_109_91_reorient.nii.gz GreyWhiteCSF_mask_91_109_91_reorient.nii.gz Axial (LPS) 91x109x91,1
image range 0.0 3.0
Checked Gray/White/CSF image size

Checking transformations
it(0) = 0 {}
it(1) = 0 {}
it(2) = {} {}
Transformation list = {0 {}} {0 {}} {{} {}}
Bad Transformation Set {0 {}} {0 {}} {{} {}} (or identity)
Transformation Check Failed 

I added the GrayCSFWhite mask at "fMRI Single Subject Analyzer| Study definition| GrayCSFWhite Map", the dimension of this map was "91*109*91". It should be noted that if i do Seed-to-voxel connectivity without "Regress CSF/White matter Mean", no errors were existed!

I run BioImageSuite with Ubuntu-14.04 64 bit. My functional MRI data is: 91*109*91*200(frames);

Thanks for your help!

Meiling
Jul 27, 2017  06:07 PM | Xenophon Papademetris
Regress CSF/WhiteMatter mean
Meiling,

It appears that you have no transformations loaded … please send me (via direct e-mail Xenophon Papademetris at yale dot edu) your .xmlg setup file.

Xenios
Jul 28, 2017  03:07 PM | Meiling Li
RE: Regress CSF/WhiteMatter mean
Hi Xenios,

Thank you for your quick response!
I am so sorry I don't understand which transformation file you mean... 
Today, i tried the preprocessing step by step using the following commands, it really works well!

# 1. Motion, CSF, white, gray matter regression
bis_csfwmmotioncorr --inp ${InPath}/${subject}/rfMRI_REST.nii.gz --inp2 ${TemplatePath}/GrayWhiteCSF_mask_91_109_91.nii.gz --docsfwm 1 --usemask 1 --out ${OutPath}/${subject}/rfMRI_REST_resid.nii.gz

# 2. remove temporal Drift
bis_removetemporaldrift --inp ${OutPath}/${subject}/rfMRI_REST_resid.nii.gz --inp2 ${TemplatePath}/N12Trio_avg152T1_brain_MNI_bi.nii.gz --out ${OutPath}/${subject}/rfMRI_REST_resid_drift.nii.gz --order 1 --usemask 1

# 3. temporally smooth(zero mean, unit variance Gaussian filter)
bis_temporalsmoothimage --inp ${OutPath}/${subject}/rfMRI_REST_resid_drift.nii.gz --inp2 ${TemplatePath}/N12Trio_avg152T1_brain_MNI_bi.nii.gz --out ${OutPath}/${subject}/rfMRI_REST_resid_drift_Lpss.nii.gz --blursigma 1 --usemask 1

However, I am still confused:
1) In the step 1, if i want to regress the mean signal of CSF, white matter and gray matter separately, should I set the value of the mask "GrayWhiteCSF_mask_91_109_91.nii.gz "  from 1 to 3 (such as Gray matter as 1, white matter as 2, CSF as 3).

2) Is there a easier way to finish the steps (may not change the preprocessing order..) i did which may do not save the intermediate outputs(because it's really time-consuming). 


Thanks again.


All the best,
Meiling



Jul 28, 2017  07:07 PM | Xenophon Papademetris
RE: RegressCSF/WhiteMatter mean
Meiling,

You have gotten deep into the code! Yes, there are ways to instantiate the modules in code to create custom pipelines. Take a look (for example) at bioimagesuite/bis_algorithm/bis_spectapp.tcl (see the execute method) for example of how to create pipelines in TCL by instantiating the modules and passing outputs to inputs.

Xenios
Jul 29, 2017  01:07 AM | Meiling Li
RE: RegressCSF/WhiteMatter mean
Hi Xenios,
Sorry to bug with the same problem. In my previous post, I do the Motion, CSF, White, gray matter regression using the following command (in bash):

# 1. Motion, CSF, white, gray matter regression
bis_csfwmmotioncorr --inp ${InPath}/${subject}/rfMRI_REST.nii.gz --inp2 ${TemplatePath}/GrayWhiteCSF_mask_91_109_91.nii.gz --docsfwm 1 --usemask 1 --out ${OutPath}/${subject}/rfMRI_REST_resid.nii.gz

it works well. However, when i add the motion correction like:
 
bis_csfwmmotioncorr --inp ${InPath}/${subject}/rfMRI_REST.nii.gz --inp2 ${TemplatePath}/GrayWhiteCSF_mask_91_109_91.nii.gz --filename ${InPath}/${subject}/rfMRI_REST_movement.mat --domotion 1 --docsfwm 1 --usemask 1 --out ${OutPath}/${subject}/rfMRI_REST_resid.nii.gz

errors exited again

Using Mask ...
Beginning vtkbisCsfWmMotionCorrection
vtk: /agrino2/src/bioimagesuite3_base_orig/InsightToolkit-3.10.0/Utilities/vxl/core/vnl/algo/vnl_svd.txx:43: vnl_svd::vnl_svd(const vnl_matrix&, double) [with T = double]: Assertion 'm_ > 0' failed.
/data/user/limeiling/SoftWare/bioimagesuite30_64/bin/bis_csfwmmotioncorr: line 24: 8395 Aborted (core dumped) ${BIS_VTK_DIR}/../../bin/vtk ${BASE}/bis_algorithm/bis_csfwmmotioncorr.tcl -- $@

my functional MRI data is 91*109*91*200, the dimension of the matlab motion file "rfMRI_REST_movement.mat"  is: 200*12 (12 motion parameters).

Actually, i didn't find the directory "/agrino2/src/bioimagesuite3_base_orig/ " ....


Meiling
Jul 31, 2017  02:07 PM | Xenophon Papademetris
RE:RegressCSF/WhiteMatter mean
This may be a .mat problem ... BioImage Suite can only read old style matlab matrix .mat format. Let me check on Monday and get back to you as to how to save to this.