Hi Peter,
> First of all, thank you so much, I am standing on the shoulders of giants
As are we all.
! Your code is very helpful, I had to modify it by using the following:
>
> Vn = squeeze(V(n,:))
> Voln=squeeze(vol(:,:,:,n0)
>
> Then feed the individual images into spm_fileparts and spm_write_vols one at a time (it was complaining when I tried to do it with the full array of all 6 tissue class images at once). I will need to write some loops so it's not tedious to do for each of the 6 tissue classes, but it seems like it should work.
Glad to hear. My code snippet assumed you already have the TPM in a 4D
format, which does not seem to have been the case, but you worked
yourself out of this.
The output seems to make sense. Just to check my understanding, this
means that classes 1 - 5 (in a 6 class solution) are unchanged, other
than replacing the zeros with eps() and all the "junk" is simply added
into the background class (class 6). This means that there are negative
numbers in the background class. For some reason, I had assumed that
having negative numbers would be an issue but apparently it isn't for SPM?
Let us put it this way, it is a dirty solution from a mathematical
elegance point of view, but I have never seen this to cause an issue.
Obviously you achieved very good results with this strategy in your
paper. There are also some probabilities that are greater than 1, for
instance, in the white matter class many of the CAT segmentations have
"1.1" as a value for voxels, I assume that this is also unproblematic
for SPM?
This should not actually be the case. One reason I could think of is
that you are still using some kind of modulation (which you shouldn't)
or that some post-hoc filtering leads to this. You could simply replace
all values exceeding 1 with 1.
Would it make any difference to, say, replace 0's with eps(), then scale
all tissue classes 1-6 from 0 to 1 on a voxel by voxel basis across
classes, then do the subtraction from the background class as
implemented below to make sure they all sum to 1?
I would be careful with treating all classes equally as many of the
optimizations within CAT12 are specially applied to GM and WM, and not
to the other classes. Making sure they sum to 1 is therefore
particularly important, but I would rather lay the burden on the
less-relevant classes (i.e., 6) than fiddle with the prime classes
(i.e., 1 & 2).
> In terms of advertising, I HAD considered using cerebromatic, not only to generate priors for my population but to derive new regression parameters from the CAT12 segmentations of my population in order to incorporate additional predictors into the model that may be of interest in an older population of mci and demented individuals. Every time I try to generate TPMs using cerebromatic, it gives me the following:
>
> Error using medfilt3
> Expected [m n p] to be odd
This is an error which I had not foreseen in the early days as there is
now a Matlab function with that name that previously didn't exist
(introduced only in R2017b, I think). The error comes from the toolbox
calling the original function, not the one from Damien Garcia I
recommend. To avoid this, I now include the function in the toolbox and
and renamed it to avoid confusion. I can send you that latest version
off-list and will make sure it is updated soon on the website.
> And then kicks out a number of other errors. I tried reinstalling with a fresh version of matlab and SPM to see if it was a system specific bug, but it has done this on two different computers. Any idea what is going on or how to fix? I had thought to play around with the filter size in the com_gen script and see if that fixes it but hadn't gotten around to it yet.
Another way around it would be to use Gaussian, not median filtering, or
to put the Damien Garcia function higher up in Matlab's search path.
> ONE final question: I was trying to get CAT12 to output tissue probability maps using unified segmentation non-linear registration only (i.e., not DARTEL). When I change the cat_main code to be "do dartel = 0" it won't output warped images. It says in the CAT12 manual that it IS capable of generating normalized tissue maps using unified segmentation normalization only but I can't seem to find where that option is...how did you do this in your paper?
I hacked cat12, much to Christian's dismay :) I would actually have to
look how I did this (it was several workarounds) but an effective (but
yet again dirty) shortcut is to set all DARTEL iterations to 1 and all
stabilizing parameters to Inf. This will not formally, but effectively
disable DARTEL processing.
> Thank you so much for your help, it means a lot to me!
Glad it works for you (somehow ;)
Cheers
Marko
--
____________________________________________________
Prof. Dr. med. Marko Wilke
Facharzt für Kinder- und Jugendmedizin
Leiter, Experimentelle Pädiatrische Neurobildgebung
Oberarzt der Abteilung Neuropädiatrie
Universitäts-Kinderklinik
Marko Wilke, MD, PhD
Pediatrician
Head, Experimental Pediatric Neuroimaging
Consultant in Pediatric Neurology
University Children's Hospital
Hoppe-Seyler-Str. 1
D - 72076 Tübingen, Germany
Tel. +49 7071 29-83416
Fax +49 7071 29-5473
[log in to unmask]
http://www.medizin.uni-tuebingen.de/kinder/epn/
____________________________________________________
|