layerfMRI/LAYNII

Holes in the middle gray matter file cause problems in LN2_LAYERS and LN2_MULTILATERATE

AtenaAkbari opened this issue · 4 comments

Dear Laynii team,

Thanks a lot for all the helpful youtube tutorials.

I have a question for you. The midgm file that I get as one of the LN2_LAYERS output is a series of disconnected voxels, it is not a continuous nice and clean midline as expected. Thus, when I look at its 3D representation in itksnap it's like a porous surface (nothing like what I see in the tutorial). So I cannot proceed with the flattening. I think the problem might be with my aseg file (even after using the "segmentation_polish" python script, the midgm still doesn't look good). I have included the original and polished aseg files here, could you possibly take a look and let me know what you think? BTW, I have segmented a part of the aseg file to do all layer analysis on that called segmented_aseg_polished.nii. I'm using LayNii v2.2.0.
troubleshooting.zip

Thank you for your help.
All the bests,
Atena

Dear @AtenaAkbari ,

Thanks for your question and nicely preparing a folder for us to have a quick look. It seems that you have 1 major issue in your data and 1 issue with regards to LayNii usage:

  1. Poor gray matter segmentation quality. By inspecting your aseg_rim.nii.gz and segmented_aseg_polished.nii.gz files, it seems clear that your initial segmentation (done by Freesurfer I assume) is poor quality around the calcarine sulcus. You can see that there are many places where the gray matter seems only one voxel thick which is around 0.75 mm. There are even spots with no gray matter at all. In this case it is expected that the polishing script will be of no help, and would even degrade the quality further. Fixing this issue will not be easy, however I very strongly advise you to improve your initial gray matter segmentation in some way (through parameter tweaking, denoising, manual editing or a combination of all three). Maybe you can take some pointers from my lectures on this topic: Segmentation for layer-fMRI: Part I and Segmentation for layer-fMRI: Part II . Segmentation quality is extremely important for doing layer analyses, and I cannot stress this point enough. Independent of LayNii, with any laminar analysis program, you need to make sure that you have good segmentation quality to begin with.

seg_problem

  1. Flattening with 0.75 mm iso input. I have developed this flattening algorithm on <0.35 mm iso. data. And did not have a chance to test it on 0.75 - 0.8 mm inputs yet. I can predict several complications that might rise from this. However, I consider this as a secondary issue because a simple 2X upsampling on your 0.75 mm inputs would solve this problem. I can provide more guidance on this issue once you have better initial segmentations. Otherwise, we can still find workarounds but the initial segmentation error will propagate and give you the wrong results of the cortical gray matter signals.

I hope these answers are helpful. Please don't hesitate to ask further questions :)

As a clarification on why there are holes in your midGM file:
The algorithms used in detecting middle gray matter crossing compares the voxels below and above the middle gray matter cortical depths (numerical value 0.5). When there is a oinly a single voxel, this algorithm does not detect any crossing. I have made this behavior intentionally because it is not a good idea to look for multiple layers when you have a single voxels.

However, if you really need, I can consider changing this behavior. But again, this would not solve the cases where you have no graymatter voxels in between white matter and outside of gray matter voxels.

Thanks a lot, @ofgulban for your response. I'll try to improve the segmentation (I also very much appreciate it if you have any specific suggestion-will check your talks as well). And as for the laynii, I'll upsample the data.
Will let you know of the results.
Thanks again.

bests regards
Atena

If you can forward me your anatomical data (can be a private mail too if it is an issue), I can have a look and tell you how it might be improved before it goes into the automatic segmentation algorithm. A bit of preprocessing might save you a lot of manual work.

Good luck :)