scil-vital / dwi_ml

Code for people working on machine learning for diffusion MRI
MIT License
8 stars 7 forks source link

ENH: make cache clearing optional #238

Closed AntoineTheb closed 2 weeks ago

AntoineTheb commented 5 months ago

Description

Fix #236

Testing data and script

Have you

People this PR concerns

@EmmaRenauld

AntoineTheb commented 5 months ago

From what I found the files that import interpolation are dwi_ml/models/main_models.py dwi_ml/tracking/tracking_mask.py

I added the option in tracking_mask, but not in main_models as the object structure is a bit complex and dependant to your use case. If you can point me to where the option should be added I can include it, otherwise I think this could work as is. Thanks !

EmmaRenauld commented 5 months ago

From what I found the files that import interpolation are dwi_ml/models/main_models.py dwi_ml/tracking/tracking_mask.py

I added the option in tracking_mask, but not in main_models as the object structure is a bit complex and dependant to your use case. If you can point me to where the option should be added I can include it, otherwise I think this could work as is. Thanks !

Yeah... It's a bit convoluted, and the doc is not up-to-date, sorry. In the case where you need one input in your model, from one group in the hdf5, you can use the classes DWIMLTrainerOneInput, DWIMLBatchLoaderOneInput, and MainModelOneInput. Here's how they interact:

So.. I think I would add it as a parameter of the batch_loader: in the __init__ at line 328, and then when you call the method at line 405. Just set it to true by default, I'll see eventually if I want to add the option in the learn2track script and transformer script.

For tracking_mask, it's okay for now.

AntoineTheb commented 5 months ago

Sorry for the late update @EmmaRenauld, let me know if that corresponds to what you wanted.