help > RE: Lesion Masks
Dec 6, 2019  01:12 PM | Alfonso Nieto-Castanon - Boston University
RE: Lesion Masks
Hi Hanna

Sorry there is no yet streamlined procedure to do this. I would recommend creating a modified TPM.mat file by adding you lesion mask as an additional tissue class. You can do that, for example, using something like the following (change the folder and file names accordingly):

   spm_imcalc({'/software/spm12/tpm/TPM.nii,1','/data/MyOriginalLesionMask.nii'},'/data/MyResampledLesionMask.nii','i2');

   spm_file_merge({'/software/spm12/tpm/TPM.nii', '/data/MyResampledLesionMask.nii'}, '/data/MyNewTPM.nii');

The first line resamples your original lesion mask to the same size & orientation as SPM's default TPM file, and the second line creates a new TPM file by concatenating the SPM's default TPM file with your new (resampled) lesion file. 

Last, when you run functional or structural normalization in CONN you may simply use your modified newTPM.nii file by either: a) (in the GUI) when prompted uncheck the option labeled 'use default Tissue Probability Map' and select the new file there; or b) (using batch) enter the new TPM file in the field "batch.Setup.preprocessing.tpm_template". By default CONN will use a mixture of 4 gaussians to fit the intensity distribution within any newly defined tissue classes, if you prefer to change that behavior you may do that using the batch field "batch.Setup.preprocessing.tpm_ngaus"

Hope this helps
Alfonso

Originally posted by hannasofia:
Hi, 

I would like to mask out stroke lesions but cannot find a way to do so. Conn is a very good program and it would be great if this could be done in the preporocessing in Conn. 

I found the following thread (see below) but do not know how to actually do it. Can I enter a seventh tissue class in one of the preprocessing steps in conn? Do I have to import a mask of the lesion? If so, can it be from ITK snap saved as a nifti file? Or can I draw the lesion in Conn? If this is not possible, should a TPM file be created and where is that done and where do I import it into conn?

Any help would be highly appreciated. 

Best Regards,
Hanna 
Originally posted by Giuliana Giorjiani:
Dear all,

How could I modify the TPM.nii file? Should I add a new 3D image to the TPM.nii file with the lesion masks of all my subjects?

Thanks!
Giuliana

Originally posted by Alfonso Nieto-Castanon:
Hi Cole,

The procedure in SPM12 to include lesion masks is to modify the file TPM.nii (tissue probability maps) by adding a new tissue class indicating the spatial distribution of the lesions. You may either modify SPM's TPM.nii file directly (located in spm12/tpm/TPM.nii), or define your own TPM.nii file and let CONN know that you would like to use that alternative tpm file instead (e.g. if using batch scripts in CONN you would do this using the fields batch.Setup.preprocessing.tpm_template and batch.Setup.preprocessing.tpm_ngauss)  

Hope this helps
Alfonso
 
Originally posted by Cole Sugden:
Hello!
Some of my participants have very large lesions due to arterial stroke and the segmentation process has incorrectly classified the lesion as grey and white matter rather than CSF. To try to adjust for this and to help with normalisation, I would like to use  Cost Function masking to individually fix the issue.  

My question is, at which point in preprocessing can I enter the lesion mask image? It does not seem to be an option in SPM12 and I prefer to use CONN. Is there a way I would be able to manually enter them somewhere?

Thanks! 

Cole

Threaded View

TitleAuthorDate
Cole Sugden May 26, 2016
Marcela Takahashi Mar 21, 2019
Alfonso Nieto-Castanon May 28, 2016
Giuliana Giorjiani Dec 6, 2018
hannasofia Dec 4, 2019
RE: Lesion Masks
Alfonso Nieto-Castanon Dec 6, 2019
Alana Batista Mar 15, 2021
Fabian Messmer May 14, 2021
Marianna La Rocca Apr 6, 2020
Matthew Heard Jan 21, 2019
Wouter De Baene Apr 25, 2019
Gianluca Saetta Feb 17, 2019