Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the probabilistic maps for the Segmentation? #254

Open
estheryclin opened this issue Sep 23, 2016 · 5 comments
Open

Update the probabilistic maps for the Segmentation? #254

estheryclin opened this issue Sep 23, 2016 · 5 comments

Comments

@estheryclin
Copy link

Because we have had issues that data of two subjects cannot be segmented correctly.
We found that pypreprocess is using the probabilistic maps for SPM8
'/i2bm/local/spm12/toolbox/OldSeg/grey.nii',
'/i2bm/local/spm12/toolbox/OldSeg/white.nii',
'/i2bm/local/spm12/toolbox/OldSeg/csf.nii'

When we tried with the latest probabilistic maps for SPM12, it solved our problems.
/i2bm/local/spm12/tmp/TMP.nii.1 % grey matter
/i2bm/local/spm12/tmp/TMP.nii.2 % white matter
/i2bm/local/spm12/tmp/TMP.nii.3 % CSF
/i2bm/local/spm12/tmp/TMP.nii.4 % bone
/i2bm/local/spm12/tmp/TMP.nii.5 % soft tissue
/i2bm/local/spm12/tmp/TMP.nii.6 % air/background

Do you have any concern to keep the SPM8 maps, or could it be updated to the SPM12 version?
Thanks!

@mrahim
Copy link
Collaborator

mrahim commented Sep 23, 2016

Actually "OldSeg" in spm12 (equivalent to "Segment" in spm8) needs grey/white/csf.nii to carry the segmentation.
"Segment" in spm12 (equivalent to "NewSegment" in spm8) needs TPM/tpm.nii.

Could you copy/paste your script ?

@estheryclin
Copy link
Author

estheryclin commented Sep 23, 2016

You mean the MATLAB code for the step Segment?
Below it is.

stage = stage + 1;
stage_segmentation = stage;

matlabbatch{stage}.spm.spatial.preproc.channel.vols = {anatfile };
matlabbatch{stage}.spm.spatial.preproc.warp.write = [0 1];
matlabbatch{stage}.spm.spatial.preproc.channel.biasreg = 0.001;
matlabbatch{stage}.spm.spatial.preproc.channel.biasfwhm = 60;
matlabbatch{stage}.spm.spatial.preproc.channel.write = [0 1];
ngaus  = [1 1 2 3 4 2];
native = [1 1 1 0 0 0];
for c = 1:6 % tissue class c
    matlabbatch{stage}.spm.spatial.preproc.tissue(c).tpm = {
        fullfile(spm('dir'), 'tpm', sprintf('TPM.nii,%d', c))};
    matlabbatch{stage}.spm.spatial.preproc.tissue(c).ngaus = ngaus(c);
    matlabbatch{stage}.spm.spatial.preproc.tissue(c).native = [native(c) 0];
    matlabbatch{stage}.spm.spatial.preproc.tissue(c).warped = [0 0];
end
matlabbatch{stage}.spm.spatial.preproc.warp.mrf = 1;
matlabbatch{stage}.spm.spatial.preproc.warp.cleanup = 1;
matlabbatch{stage}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2];
matlabbatch{stage}.spm.spatial.preproc.warp.affreg = 'mni';
matlabbatch{stage}.spm.spatial.preproc.warp.fwhm = 0;
matlabbatch{stage}.spm.spatial.preproc.warp.samp = 3;
matlabbatch{stage}.spm.spatial.preproc.warp.write = [1 1];

@mrahim
Copy link
Collaborator

mrahim commented Sep 23, 2016

Well, I was expecting pypreprocess script :)

Anyway, this looks like Segment in spm12 which uses tpm.nii

In pypreprocess, if you do newsegment = True in your config file, it will use spm12 tpms.

@estheryclin
Copy link
Author

Yes, I've seen the "newsegment" option in my config file.
I will try it out, thank you! :)

@chrplr
Copy link
Contributor

chrplr commented Feb 14, 2018

If we now accept that spm12 is the default, we should not use newsegment=True, but just segment=True, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants