Bug in Primatologist -> Brain Parcellation (EM)

BrainVisa toolbox for histology, biology, 3D reconstruction of animal slices
Post Reply
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

Bug in Primatologist -> Brain Parcellation (EM)

Post 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
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
yael
Posts: 5
Joined: Tue Feb 20, 2018 6:10 pm
Location: WCHN, UCL, London

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

Post 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
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

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

Post 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
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

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

Post by riviere »

Hi,
Yaël has done a fix, that you can get here:
ftp://ftp.cea.fr/pub/dsv/anatomist/upda ... gist/io.py
Denis
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

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

Post by Olivier Coulon »

Thank you ! I tried a simple fix myself already and it worked.
I will use yours and let you know.

Olivier
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

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

Post 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/htqie5zwvhvz2 ... t.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
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
yael
Posts: 5
Joined: Tue Feb 20, 2018 6:10 pm
Location: WCHN, UCL, London

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

Post 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
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

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

Post by Olivier Coulon »

Here it is, affine on the left, non linear on the right.
https://www.dropbox.com/s/1026o4ltxlylt ... r.jpg?dl=0

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


Olivier
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
yael
Posts: 5
Joined: Tue Feb 20, 2018 6:10 pm
Location: WCHN, UCL, London

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

Post 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
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

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

Post by Olivier Coulon »

Of course, let me know how I can help.
Thanks.

Olivier
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
yael
Posts: 5
Joined: Tue Feb 20, 2018 6:10 pm
Location: WCHN, UCL, London

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

Post 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
User avatar
Olivier Coulon
Posts: 176
Joined: Fri Feb 27, 2004 11:48 am
Location: MeCA research group, Institut de Neurosciences de La Timone, Marseille, France
Contact:

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

Post 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 ... YSy7DEgQXA

Let me know if I can help.

Olivier
Olivier Coulon
Institut de Neurosciences de La Timone,
Aix-Marseille Université,
Marseille, france
https://meca-brain.org
yael
Posts: 5
Joined: Tue Feb 20, 2018 6:10 pm
Location: WCHN, UCL, London

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

Post 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
Post Reply