pycortex
pycortex copied to clipboard
Should be able to generate mask w/o flat surface
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).
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?
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.
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.
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.
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.
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.
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.
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?