Tissue prior output volumes in random order
Description
I generated tissue maps from some pre-computed Q-ball peaks:
from dipy.segment.tissue import TissueClassifierHMRF
hmrf = TissueClassifierHMRF()
apm = anisotropic_power(qball_peaks.shm_coeff)
results = hmrf.classify(apm, nclass=3, beta=.1)
The third output in results is the PVE volume which contains the 3 identified classes. They follow a random order when I compared the volumes from different subjects using the same script. Is there a way to make the volumes follow a fixed order? Here is what MRTrix used:
0: Cortical grey matter
1: Sub-cortical grey matter
2: White matter
3: CSF
4: Pathological tissue
https://mrtrix.readthedocs.io/en/dev/quantitative_structural_connectivity/act.html
From what I understand it should not be random, given the innate intensity difference between CSF, GM and WM. Do you have some images of how it is random? For example does CSF and GM change classes with each other sometimes?
From what I see in HCP 7T data, it's random among all three, not only between CSF & GM. Here's an example from two HCP subjects.
Subject 100610:
0:
1:
2 (basically empty):
Subject 102816:
0:
1:
2:
I see. I still think it is ordered intensity wise, but it is giving unstable results. You can see that on subject 100610 GM and CSF share labels, which is why WM got label 1 and there is almost nothing for label 2.
I am not sure what happened on 102816, but it seems to be a similar problem of GM and CSF being mixed up.
This seems to be a limit of the method itself, which hopefully we will be able to address later on. For now, could you try maybe changing the number of classes to 4? I found that using 4 can sometimes give better results (where 0 is CSF, 1 is GM, 2 and 3 is WM)
This would not be a problem with analyses using just a few subjects because one can manually identify the tissue maps. It becomes a real problem with batch processing. For example, I need to run the same algorithm through 100+ subjects and it won't be practical to check each individual. In the latter case, I don't think changing the number of classes would guarantee the consistency across subjects.
I agree. It was just a workaround I found when dealing with few subjects. We could definitely benefit from a more robust/less tweaking required tissue segmentation. But maybe others have an easier solution for now.
Yeah, I have a temporary solution using the aparc+aseg files provided by HCP to match the tissue masks. But general users would benefit more from something independent of additional check files.
I think when we say 3 it is actually 4. 3 + background.
The mean intensity for each class should be different and easy to sort. Background should have the lowest, csf second lowest, gm should be the third intensity and wm should be the last. You can use the mean intensity for each class to correct the order of the labels. To move to a 5 class representation that separates cortical to subcortical wm should not be a problem. But currently it is not available with this HMRF application. But if the current order is random we should fix that.
@Garyfallidis The current order is not random. It appears random because CSF and GM had some issues separating but as you can see from the images WM is always a higher class.
Okay, indeed the error seems different. Good catch @pjsjongsung
I see, now that makes sense. It's a tissue separation issue, not order issue. Nonetheless the issue seems prominent. I checked the 176 HCP 7T subjects, only about 80 had correct tissue classification like the second subject above. The rest of the subjects mostly had GM + CSF mixing like 100610, but 20+ subjects had WM + CSF mixing as well:
0:
1:
2:
ACT breaks down with either type of mixing.
Great feedback. Please send us a couple of the data that fail.
Sure, I'm using the HCP 7T data on UITS' storage /N/project/hcp_dcwan. Here are some problematic subjects:
- GM + CSF mixing: 100610, 406836, 901442
- WM + CSF mixing: 436845, 200614
- A weird GM + WM mixing: 111312