Skip to content

Tool to add MCM data on Tractography data#83

Open
astamm wants to merge 6 commits into
masterfrom
mcm_info_on_tracts
Open

Tool to add MCM data on Tractography data#83
astamm wants to merge 6 commits into
masterfrom
mcm_info_on_tracts

Conversation

@astamm

@astamm astamm commented Jan 11, 2022

Copy link
Copy Markdown
Contributor

New tool to add an interpolated MCM at each point of a collection of tracts.

@ocommowi ocommowi force-pushed the master branch 2 times, most recently from b3f19d7 to afcf4f4 Compare January 28, 2022 14:39

@Florent2305 Florent2305 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request a test on MSVC

COMPONENT(DDI) \

#define GENERATE_ENUM(ENUM) ENUM,
#define GENERATE_STRING(STRING) #STRING,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must test this macro on MSVC.

#include <AnimaMCMBaseExport.h>
#include <animaMCMConstants.h>

#define FOREACH_COMPONENT(COMPONENT) \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Macros are in themselves a bit ugly, but in multi lines it's worse.

@astamm

astamm commented Oct 4, 2023

Copy link
Copy Markdown
Contributor Author

Thanks @Florent2305. This PR should actually not be merged yet. More work is needed following discussions with @jcoloigner who I invite to join the conversation here.

I also think we should think of a better more consistent naming convention. Since it is primarily related to fibers the tool should be name starting with animaFibers....

@astamm

astamm commented Feb 27, 2025

Copy link
Copy Markdown
Contributor Author

@Florent2305 it breaks the CI because of, again, an issue in decompressing the Boost archive it downloads. Can you look into it please?

@MaheyG @MariePoirierGit @Florent2305 @jcoloigner @ecaruyer : now for each point of each cell of the VTK file (a cell is a streamline for us), the tool outputs:

  • the 3D coordinates X, Y and Z of the point;
  • PointId which is the rank of that point in its streamline;
  • StreamlineId which is the ID of the streamline to which the point belong;
  • MostColinearIndex which is the index of the component in the mixture that has the most collinear direction to the current local direction of the streamline;
  • the weights of each component/compartment;
  • the parameters (other than the weight) of the 1st component;
  • the parameters (other than the weight) of the 2nd component;
  • ...

Parameter names are encoded using {NAME_OF_COMPARTMENT}Parameter{ID_OF_PARAM} where {NAME_OF_COMPARTMENT} is automatically inferred from the .mcm XML file and {ID_OF_PARAM} follows the order of parameters should be documented by referring to the GetModelVector()/SetModelVector() of each compartment implementation in diffusion/mcm.

Weight names are encoded using {NAME_OF_COMPARTMENT}Weight. For anisotropic compartments the same name of compartment will appear several times, hence the tool appends the ID (1-indexed) of the anisotropic compartment.

Can you all test this and report if not working or if any improvement comes to your mind? Thanks!

@astamm

astamm commented Feb 27, 2025

Copy link
Copy Markdown
Contributor Author

Request a test on MSVC

@Florent2305 : About your previous review, I agree but not sure it is related to this PR for which I only added one more tool.

About my comment of naming conventions, since we are working on that in the refactoring, I guess here it is no longer a concern.

@astamm

astamm commented Mar 3, 2025

Copy link
Copy Markdown
Contributor Author

@Florent2305 @MaheyG @MariePoirierGit @jcoloigner @ecaruyer any comments team?

@MaheyG

MaheyG commented Mar 13, 2025

Copy link
Copy Markdown

Hi! I tried AddMCMToTracts, with success. I though that the function was clear.

I just have a remark regarding the n=0 (i.e. only isotropic compartment) case. It seems that the function failed to add the 'FreeWaterParameter' array to the track.

Typically, calling:
./animaAddMCMToTracts -i my_track.vtp -m my_iso_compartement.mcm -o my_track_iso.vtp
rise the error "Erreur de segmentation (core dumped)"

with my_iso_compartement.mcm obtained via:
./animaMCMEstimator -F -c 3 -n 0 -i my_subject.nii.gz -b my_subject.bval -g my_subject.bvec -o my_iso_compartement.mcm

It is possible to fix this particular case?
Many thanks!!

@astamm

astamm commented Mar 14, 2025

Copy link
Copy Markdown
Contributor Author

Thanks @MaheyG. Can you please put the data somewhere you can share with me so that I can reproduce locally the issue and provide a fix?

@astamm

astamm commented Mar 14, 2025

Copy link
Copy Markdown
Contributor Author

Also adding @adelesavalle to this conversation in case you are willing to test the tool.

@MaheyG

MaheyG commented Mar 14, 2025

Copy link
Copy Markdown

Thanks @MaheyG. Can you please put the data somewhere you can share with me so that I can reproduce locally the issue and provide a fix?

Sure, you can find my data here
https://uncloud.univ-nantes.fr/index.php/s/TiML3pxNMQKFSAn

@nathandecaux

Copy link
Copy Markdown

@Florent2305 it breaks the CI because of, again, an issue in decompressing the Boost archive it downloads. Can you look into it please?

@MaheyG @MariePoirierGit @Florent2305 @jcoloigner @ecaruyer : now for each point of each cell of the VTK file (a cell is a streamline for us), the tool outputs:

* the 3D coordinates `X`, `Y` and `Z` of the point;

* `PointId` which is the rank of that point in its streamline;

* `StreamlineId` which is the ID of the streamline to which the point belong;

* `MostColinearIndex` which is the index of the component in the mixture that has the most collinear direction to the current local direction of the streamline;

* the weights of each component/compartment;

* the parameters (other than the weight) of the 1st component;

* the parameters (other than the weight) of the 2nd component;

* ...

Parameter names are encoded using {NAME_OF_COMPARTMENT}Parameter{ID_OF_PARAM} where {NAME_OF_COMPARTMENT} is automatically inferred from the .mcm XML file and {ID_OF_PARAM} follows the order of parameters should be documented by referring to the GetModelVector()/SetModelVector() of each compartment implementation in diffusion/mcm.

Weight names are encoded using {NAME_OF_COMPARTMENT}Weight. For anisotropic compartments the same name of compartment will appear several times, hence the tool appends the ID (1-indexed) of the anisotropic compartment.

Can you all test this and report if not working or if any improvement comes to your mind? Thanks!

Hello! Regarding MostColinearIndex, it gives the "real" index of the component, but then uses a different index for the parameters/weights of the anisotropic compartments (the 1-indexed one). So you still need the .mcm file in addition to the vtk to map the ID to the correct compartment. Wouldn't it be more logical to:

  • use the actual compartment ID to differentiate between anisotropic compartments
  • or return the 1-indexed ID in MostColinearIndex ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants