populse / mri_conv

3 stars 0 forks source link

Get bvec/bavl files for diffusion when using BIDS #13

Closed manuegrx closed 1 year ago

manuegrx commented 1 year ago

In a BIDS folder, for diffusion data, ".bvec" and ".bval" files are already created (with the same name as the NIfTI file except for the extension) As discussed together, it would be useful to keep those files and to be able to export them in the same folder as the NIfTI/json pair in order to sued them in MIA for example.

montigno commented 1 year ago

Hi,

A new version of mri_conv is available (23.4.0a).

Please keep me informed.

Olivier

manuegrx commented 1 year ago

Hi,

It works, thank you ! Bvec and bval are correctly import into the mia raw_data folder. For now, they are not in the database, if needed I will check how to add them.

Emmanuelle

servoz commented 1 year ago

Shouldn't bval and bvec be indexed directly in the database, like other data, when they are imported into Mia (more specifically in the folder known by Mia as raw_data)?

Would it be sufficient for them to be present in the json used for indexing at the time of import into Mia (like all other imported and indexed data)? Or is there some other constraint/reason I'm missing?

I think the current paradigm should be that data imported (or known/created as a result of a calculation) into Mia is indexed, as far as possible, in the database.

manuegrx commented 1 year ago

You right, I think It will better to have the bvec/bval indexed in the database (It will be helpfull for some mrtrix bricks for example)

Should we change in mri_conv or in Mia ?

servoz commented 1 year ago

It's been a while since I've worked on this part of the code, but I think we can find it here.

Things are collected by Mia in the logExport*.json file which, unless I'm mistaken, is sent by mri_conv ... to be checked ...

montigno commented 1 year ago

Yes, we could add this kind of information in the logExport.

See me to discuss it better.

De: "Eric Condamine" @.> À: "populse/mri_conv" @.> Cc: "OLIVIER MONTIGON" @.>, "Comment" @.> Envoyé: Vendredi 25 Août 2023 12:33:08 Objet: Re: [populse/mri_conv] Get bvec/bavl files for diffusion when using BIDS (Issue #13)

It's been a while since I've worked on this part of the code, but I think we can [ https://github.com/populse/populse_mia/blob/211ef63fbad10664ef987d22c67cecd54f84d697/populse_mia/data_manager/data_loader.py#L137 | find it here ] .

Things are collected by Mia in the logExport*.json file which, unless I'm mistaken, is sent by mri_conv ... to be checked ...

— Reply to this email directly, [ https://github.com/populse/mri_conv/issues/13#issuecomment-1693149532 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AKK4FG2CRAX4VDJOASZPZBTXXB5OJANCNFSM6AAAAAA3JVZTDU | unsubscribe ] . You are receiving this because you commented. Message ID: @.***>

servoz commented 1 year ago

If the bval and bvec files are in the json sent by mri_conv, this means that the run() method needs to be modified. ...

It may be that this method only retrieves .nii files, or that there is some other limitation (I haven't reread the method!).

To be checked ...

manuegrx commented 1 year ago

For now, .bvec and .bval files are not in the json sent by mri_conv. @montigno I will come to see you to discuss about this next week

It will be also necessary to add .bval and .bvec in the popusle_mia method (as you thought @servoz only .nii are managed for now)

servoz commented 1 year ago

The bval and bvec files are in separate file (.bvec and .bval) in the raw_data folder.

Yes, but if I remember correctly these are txt files, and I suspect that the run() method is actually only designed for nii files ... And then there are the tags ... If I still remember correctly they are retrieved from the json file associated with the nii file (which is why I think run() was originally written for nii/json files).

If there is no json associated with the files for bval and bvec I don't think it will work ...

As always, a small problem, long time to fix ...

In any case, if we had only written this part for nii/json at the start, I think it would be interesting to be able to import other types of files. Here, bval and bvec are a good example!

@manuegrx take heart, the summit is not far away !!!! but it hides the next :-)))))))

montigno commented 1 year ago

A new version of mri_conv is available (23.4.1a).

A 'bvec_bval' tag has been added in the LogExport (= 'yes' if bvec and bval files have been created or copied).

— Reply to this email directly, [ https://github.com/populse/mri_conv/issues/13#issuecomment-1693366059 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AKK4FG2WY4O27RXL4327RJLXXCSIDANCNFSM6AAAAAA3JVZTDU | unsubscribe ] . You are receiving this because you were mentioned. Message ID: @.***>

manuegrx commented 1 year ago

Thank you @montigno

montigno commented 1 year ago

A new version of mri_conv is available (23.4.2a).

bvec and bval files have now .bvec and .bvac extensions (FSL format).

The MRtrix format stay as before (.txt)

Reply to this email directly, [ https://github.com/populse/mri_conv/issues/13#issuecomment-1693366059 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AKK4FG2WY4O27RXL4327RJLXXCSIDANCNFSM6AAAAAA3JVZTDU | unsubscribe ] . You are receiving this because you were mentioned. Message ID: @.***>

manuegrx commented 1 year ago

Thank you @montigno !

However, if we want the "real" FSL format we should also change the way the bvec / bval are reported in the files (sorry I missed this part during our chat yesterday) , I open an other issue to explain more in details https://github.com/populse/mri_conv/issues/14