Closed AntoineTheb closed 2 weeks 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 !
From what I found the files that import
interpolation
aredwi_ml/models/main_models.py
dwi_ml/tracking/tracking_mask.py
I added the option in
tracking_mask
, but not inmain_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:
The trainer gets the inputs from the batch loader at line 1128 in dwi_ml.training.trainers
:
batch_inputs = self.batch_loader.load_batch_inputs(streamlines_f, ids_per_subj)
The batch_loader is the class that knows to access the hdf5 for each subjects. But it formats the inputs based on how the model tells it to at line 405 in dwi_ml.training.batch_loaders
:
subbatch_x_data = self.model.prepare_batch_one_input(streamlines, self.context_subset, subj, self.input_group_idx)
This calls the model's method, either at line 452 in dwi_ml.models.main_models
, or maybe you can overwrite it in your own model based on your needs.
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.
Sorry for the late update @EmmaRenauld, let me know if that corresponds to what you wanted.
Description
Fix #236
Testing data and script
Have you
People this PR concerns
@EmmaRenauld