cpp-lln-lab / CPP_ROI

Set of Octave and Matlab functions, demos and scripts to help manage ROIs and to play nice with BIDS datasets. Mostly volume-based and SPM centric.
https://cpp-roi.readthedocs.io/en/latest/index.html
GNU General Public License v3.0
5 stars 6 forks source link

demo create ROI with expansion case gives me 3 ROIs as result of the expansion #3

Open marcobarilari opened 3 years ago

marcobarilari commented 3 years ago

Hey, just running the demo roi_script, in the case of getDataFromExpansion(opt, dataImage, roiName); I get this

Screen Shot 2021-03-30 at 11 43 08

where this is the last result with 57 voxels, you can see that in the brain there are 3 masked spots, two in I guess MT, and 1 in some inferior part of the brain.

So two questions,

(1) is it intended to start expanding in only 1 ROI and continuing in the second one?

(2) I guess that the 3rd spot in the inferior part is there by mistake.

Also, Have you tried to save each ROI across the expansion iteration? It seems that at some point in the process it stops expanding and starts again towards the end.

Remi-Gau commented 3 years ago

(1) is it intended to start expanding in only 1 ROI and continuing in the second one?

Nope.

It starts in one ROI and the sphere will keep growing till it reaches a certain number of voxels. So if there is not enough voxels in the first ROI then the sphere will keep growing and will inevitably include stuff anywhere in the brain: including things on the other side of the brain.

(2) I guess that the 3rd spot in the inferior part is there by mistake.

Well depends what you mean by "mistake". It definitely should not be there. But I suspect that those voxels are part of the the original mask you provided.

Also, Have you tried to save each ROI across the expansion iteration? It seems that at some point in the process it stops expanding and starts again towards the end.

Not tried that specifically.

In this case I suspect, this happens because the sphere as to keep growing to get to the other side of the brain.

What we could do is make the function more verbose and spit out the radius and number of voxel included on each iteration. Might give some clue to to the user as to what is going on or if you are in a situation you can't get out of (a sphere that keep expanding forever - actually the function should stop after a certain sphere radius because brains of 2 meters do not exist).

Remi-Gau commented 3 years ago

In your case I would make sure that initial mask you use has more voxels around each ROI (use a lower voxels threshold).