Advice on subdivided parcellations

This isn’t a question strictly in the scope of MRtrix so feel free to ignore, but I’m trying to figure out a reasonable way of doing subdivided parcellations, and I think the obvious is escaping me:

With FreeSurfer, I’ve subdivided aparc with mris_divide_parcellation using the area theshold method (250.0 mm^2 generates ~500 regions per hemisphere), to obtain a new annot per hemisphere, e.g. {l,r}h.aparc250.annot. Then, I’ve generated a new aparc+aseg volume with mris_aparc2aseg ... --annot 250

The problem I run into is then generating appropriate LUT files for labelconfig: I thought I could just conver the {l,r}h.aparc250.annot files into equivalent LUT files, but in fact the region ids largely overlap, even though in the new aparc250+aseg volume, they have distinct ids.

So I reckon it’s necessary to compare the aseg volume with the aparc250+aseg (i.e. the volume for the subdivided parcellation), and for subcortical voxels, collect the aseg values & colors and for cortical voxels, collect the aparc250+aseg values & colors. Once these are collected, the unique entries can be written to a LUT file then usuable with labelconfig.

Whew… two questions:

  • I’ve been told mris_divide_parcellation does a bad job. Is there a better tool, or I should just whip up a script to do the subdivisions on the sphere myself?
  • Creating the LUT from a non-standard parcellation volume seems like it would be a common thing to do, yet I didn’t find a standardized way of doing it. Is there a script or something I completely missed?

Again, sorry if this out of scope for MRtrix, but I’d appreciate any ideas or advice here.

Hi,

I haven’t worked directly with these tools, but it seems highly unusual to me that the output volume would contain a different set of IDs to the annotation file. This might be worth triple-checking.

Creating the LUT from a non-standard parcellation volume seems like it would be a common thing to do, yet I didn’t find a standardized way of doing it. Is there a script or something I completely missed?

A quick look through their docs suggests that mris_anatomical_stats -c might be worth trying (seems an unusual place for it to me :confused:).

If you’re having trouble getting what you need to run labelconfig, one option is to just bypass it entirely. It’s there primarily for convenience, to allow fast conversion from common parcellation formats to a ‘natural numbers’ indexing system; but it’s not actually prerequisite that this command be used. Literally all it’s doing is changing the integers in an image from one value to another.

Let’s say, for instance, that mris_aparc2aseg gives you indices from 1001-1250 for left hemisphere, 2001-2250 for right, and the rest of the image is empty. You could do something like this (not tested; break it up into pieces if it doesn’t do what it’s supposed to):

mrcalc aparc250+aseg.mgz 1250 -le aparc250+aseg.mgz -mult 1000 -sub aparc250+aseg.mgz 2000 -gt aparc250+aseg.mgz -mult 1750 -sub -add nodes.mif

This extracts the left hemisphere and subtracts 1000, extracts the right hemisphere and subtracts 1750, then combines the two; so the output image will have unique indices running from 1 to 500. You could then add subcortical nodes at the end, perhaps using an intermediate labelconfig call to just pull out those structures and put them in the right order.

Obviously it doesn’t have the flexibility or convenience of labelconfig, but it works. Ultimately these images are just a bunch of integers.

The main problem is that an annotation is hemisphere-agnostic while the aparc volume isn’t, so the mrcalc trick is a great idea I’ll have to try. :thumbsup:

Old thread I guess, but I got around to replacing mris_subdivide_parcellation with a Python function which applies a k-means to each ROI to get subROIs of approximately the same surface area. This uses FreeSurfer’s spherical cortical surfaces.

The upside of this is that the resulting label volume has nearly contiguous integer values, sidestepping the problem I wrote about above in the first place.