aramis-lab / clinica

Software platform for clinical neuroimaging studies
http://www.clinica.run/
Other
221 stars 75 forks source link

t1-volume-parcellation about AAL3 #502

Closed IRIS00123 closed 2 years ago

IRIS00123 commented 2 years ago

Description I want to use the AAL3 template. when i add it by myself, I face the following problem. 211111-11:19:15,11 nipype.workflow ERROR: could not run node: t1-volume-parcellation.atlas_stats_node 211111-11:19:15,11 nipype.workflow ERROR: could not run node: t1-volume-parcellation.atlas_stats_node

Pipeline Which Clinica's Pipeline is concerned?

omar-rifai commented 2 years ago

Hello, thank you for your interest in Clinica.

Can you please provide the full error log (as an attachment) so that we can help you find the issue.

Regards

IRIS00123 commented 2 years ago

The full error log has been attached, please check it, thank you!

Have you considered adding AAL3 to the official code? AAL3 adds a number of brain areas not previously defined, but of interest in many neuroimaging investigations.

clinica.log

omar-rifai commented 2 years ago

Thank you ! it looks like the mask provided is of the wrong dimension:

masked_data[np.invert(current_mask_label)] = 0 IndexError: boolean index did not match indexed array along dimension 0; dimension is 121 but corresponding boolean dimension is 181

@MatthieuJoulot is trying to replicate

MatthieuJoulot commented 2 years ago

Hi @IRIS00123,

I've managed to reproduce the bug you have. The problem is with the dimension of the atlas you are giving t1-volume.

Our atlas are meant to be used with a pixel dimension of 1.5mm and a dimension of (121, 145, 121). To solve this, I used FSLeyes and used the fonction resample. You just have to change the pixel dimension to 1.5. It doesn't matter that the values are not precisely 121 and 145, it's rounded during the saving. Afterwards you can run the pipeline again, it should work.

AAL3 seems indeed to be an atlas that comes up frequently. We will look into adding it to the list we already have. Thanks for the suggestion.

If you have any other problems don't hesitate ! And if your problem is solved, please close the issue.

Have a good day

IRIS00123 commented 2 years ago

I think the error results in that I use the official AAL3 atlas, which is not a dimension of (121, 145, 121). The dimension of the official AAL2 and AAL3 atlases are not (121, 145, 121), but the official AAL2 atlas of Clinical is a dimension of (121, 145, 121). Could you please explain how to convert it? Could you provide the AAL3 atlas with a dimension of (121, 145, 121)? Thank you very much.

Have a good day.

MatthieuJoulot commented 2 years ago

Yes, this is the problem.

To convert it, you can use FSLeyes. Once you have it, you need to load the atlas in FSLeyes and use the resampling function, with pixeldim set to 1.5mm. The dimension of the atlas will be changed accordingly into (121, 145, 121) and a few decimals. The decimals do not matter, they will be cut out during the saving. And after that you will be able to use the atlas ! I hope that I was clear, otherwise, please let me know.

The AAL3 atlas can not be distributed by us for licensing reasons, sorry.

Have a good day.

IRIS00123 commented 2 years ago

Thank you very much for your patience. According to what you said, the dimension of the atlas is transformed successfully. However, the converted atlas has some noise, as shown in the attached file. Do you encounter this problem when resampling?

Can you please tell me the parameters of resampling in FSLeyes, such as origin, interpolation, smoothing?

Thanks again.

Have a good day.

noise

MatthieuJoulot commented 2 years ago

Hi, I have not encountered this problem. The parameters I have used are as they are in the screenshot below.

Screenshot 2021-11-29 at 16 16 44

And the result I have is the following:

Screenshot 2021-11-29 at 16 21 56

I hope this helps !

Have a good day

alexandreroutier commented 2 years ago

Hi @MatthieuJoulot and @IRIS00123,

I believe you must use the "Nearest neighbour" interpolation, otherwise, you will face weird issues that would explain 3D Slicer's snapshot from IRIS00123.

Best, Alexandre

IRIS00123 commented 2 years ago

Hi @alexandreroutier,

Thank you for your reminder. It is exactly as you said.

Thanks.