pycortex icon indicating copy to clipboard operation
pycortex copied to clipboard

Should be able to generate mask w/o flat surface

Open nbilenko opened this issue 10 years ago • 8 comments

It's currently not possible to generate a cortical mask if flat surface is not available (b/c it makes impossible to strip out the medial wall voxels).

nbilenko avatar May 26 '14 22:05 nbilenko

Ok, I can fix this. However, question for other people as well -- what should happen to medial wall voxels when you request the cortical mask? Should it include those voxels as well?

jamesgao avatar May 26 '14 23:05 jamesgao

Imho it should be a flag (or a try/catch), leaving them out by default and keeping them in if the medial cut hasn't been done.

nbilenko avatar May 26 '14 23:05 nbilenko

If there’s no flat surface present, throw out a warning, but generate a mask that includes the medial wall (and whatever else might be culled in the flatmap). Store it with a different cache name. If the flatmap becomes present, return the mask that excludes the medial wall instead, but preserve old mask for plotting purposes.

On May 26, 2014, at 4:55 PM, James Gao [email protected] wrote:

Ok, I can fix this. However, question for other people as well -- what should happen to medial wall voxels when you request the cortical mask? Should it include those voxels as well?

— Reply to this email directly or view it on GitHub.

alexhuth avatar May 26 '14 23:05 alexhuth

Hmm, I think I might prefer Natalia's solution. Adding this additional logic to db.get_mask is very weird and non-intuitive. I will most likely implement the try/catch solution.

jamesgao avatar May 27 '14 00:05 jamesgao

Fair enough. But what happens if the flatmap becomes available later?

On May 26, 2014, at 5:04 PM, James Gao [email protected] wrote:

Hmm, I think I might prefer Natalia's solution. Adding this additional logic to db.get_mask is very weird and non-intuitive. I will most likely implement the try/catch solution.

— Reply to this email directly or view it on GitHub.

alexhuth avatar May 27 '14 00:05 alexhuth

It will keep returning the non-trimmed mask until you consciously go in and delete that mask. The behavior respects the rules set up for all other masks, namely that they should remain static.

The problem I have with your suggestion is mostly that when you request a named mask, it simply goes into the filesystem and finds that name. If it can't find the mask, it will call a command to generate that name. Having it suddenly save the cache to a different name requires special casing the cortical mask code even further, which I'd rather avoid.

jamesgao avatar May 27 '14 00:05 jamesgao

That’s totally fair. Sounds good.

On May 26, 2014, at 5:10 PM, James Gao [email protected] wrote:

It will keep returning the non-trimmed mask until you consciously go in and delete that mask. The behavior respects the rules set up for all other masks, namely that they should remain static.

The problem I have with your suggestion is mostly that when you request a named mask, it simply goes into the filesystem and finds that name. If it can't find the mask, it will call a command to generate that name. Having it suddenly save the cache to a different name requires special casing the cortical mask code even further, which I'd rather avoid.

— Reply to this email directly or view it on GitHub.

alexhuth avatar May 27 '14 03:05 alexhuth

Wait, which function are you using to generate the mask? I'm not getting any errors while generating the mask for a subject with no flatmap. What error is it?

jamesgao avatar May 27 '14 18:05 jamesgao