Page 1 of 1

Bug in Primatologist -> Brain Parcellation (EM)

Posted: Tue Feb 20, 2018 3:48 pm
by Olivier Coulon
Hello, moving on with the Primatologist pipeline, I encountered a new bug in the Bayesian Segmentation -> Brain Parcellation (EM) process:


list index out of range

IndexError
processes.py (3174) in _processExecution:
result = process.execution(self)

primate_Parcellation.py (429) in execution:
'-ov', ov[0], ov[1], ov[2], ov[3],


Any clue ?

Olivier

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Tue Feb 20, 2018 6:44 pm
by yael
Hi Olivier,

It seems that the read voxel size does not contain 4 values, as expected. It never happened before with me, but I obviously only used a limited range of images/formats. Could you apply aimsFileInfo (which is in brainvisa.data.neuroDiskItems) to your input file, in ipython and tell me if
1) The field 'voxel_size' is present
2) It contains 4 values
There has been some change to the handling of multi-dimensional arrays recently, so it might have changed this behaviour. If this is what is causing the bug, I can easily add some kind of check to fill missing values.

Thank you for using (or at least trying ^^) Primatologist :)

Yaël

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Wed Feb 21, 2018 9:20 am
by Olivier Coulon
Hello Yaël,
indeed, eventhough the dimensions contain 4 fields (with the last one of size 1), there are only 3 values for voxel size:


'volume_dimension': [224, 336, 448, 1],
'voxel_size': [0.399993896484375, 0.40179443359375, 0.40179443359375],


I guess this is easy to fix...

Olivier

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Wed Feb 21, 2018 11:55 am
by riviere
Hi,
Yaël has done a fix, that you can get here:
ftp://ftp.cea.fr/pub/dsv/anatomist/updates/4.6.0/python/primatologist/io.py
Denis

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Wed Feb 21, 2018 11:59 am
by Olivier Coulon
Thank you ! I tried a simple fix myself already and it worked.
I will use yours and let you know.

Olivier

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Thu Feb 22, 2018 8:14 am
by Olivier Coulon
Hello Yaël,
I managed to run the entire pipeline on two different T1 macaque images. On one of them, there is a problem that you can see on the snapshot below:

https://www.dropbox.com/s/htqie5zwvhvz2w7/primatologist.jpg?dl=0

The brain mask is cut at the top and part of the brain is excluded. I tried to track it, and this cut seem to have appeared during the template registration step. ANy clue about how to prevent this ? (because otherwise the segmentation seems very good). $

Olivier

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Thu Feb 22, 2018 11:39 pm
by yael
Hi Olivier,

I was going to blame the skull-stripping, which is the most unstable step of the pipeline, but it doesn't seem to have this cut (even though it keeps way too much tissue around the brain, there's room for improvement).
Could you post screenshots of the affine and nonlinear registration steps (there should be dedicated viewers too), in order to know which one is responsible?
The artefact is very flat. I would suspect a problem during resampling (i.e., application of the transform to the atlas) rather than during registration. There have also been a few changes to the FFD recently, so it might come from there.

Yaël

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Fri Feb 23, 2018 10:12 am
by Olivier Coulon
Here it is, affine on the left, non linear on the right.
https://www.dropbox.com/s/1026o4ltxlylty0/affine_nonlinear.jpg?dl=0

It actually stops at a specific slice, like if it was forced too.


Olivier

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Fri Feb 23, 2018 1:07 pm
by yael
I think it comes from the resampling. I'll try to reproduce the issue and let you know.
If I can't manage to reproduce it, I might need some help from you, if you don't mind (like access to the affine and FFD transforms)

Yaël

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Fri Feb 23, 2018 2:10 pm
by Olivier Coulon
Of course, let me know how I can help.
Thanks.

Olivier

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Mon Mar 05, 2018 3:25 pm
by yael
Hi Olivier,

I finally have an up-to-date Brainvisa :)
I couldn't reproduce this issue with my test data. Do you think you could give me access to tour input MRI (and maybe the resulting affine and FFD transforms) so that I test in on my machine?

Thanks a lot for your help

Yaël

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Wed Mar 28, 2018 3:18 pm
by Olivier Coulon
Hello Yaël,
sorry for the time it took to answer. I reproduced the problem on another subject. You can download the entire subject's directory following this link:

https://cloud.int.univ-amu.fr/index.php/s/k23DGYSy7DEgQXA

Let me know if I can help.

Olivier

Re: Bug in Primatologist -> Brain Parcellation (EM)

Posted: Fri Jun 29, 2018 9:29 am
by yael
Hi Olivier,

It took me even more time to answer, but the bug is finally fixed!
I also found another bug in the skull-stripping process: in T1, it selected as "brain component" components that I actually wanted to discard. It seems to work a lot better now (at least on your image).

Those two fixes have been committed to the bug_fix branch and should be included in the next bug_fix release:
- #82128
- #82130

I hope it will fix your problems. Let me know if you have any other issue (I'll try to be more reactive next time)

Best wishes,

Yaël