Closed melhemr closed 2 years ago
@melhemr What is the age range in the data set? Which harmonization model was used? I think that the age range defined in datamodel.py
of 25 to 95 was bigger than the one in the harmonization model. Thus, the age range should be extracted from the harmonization model.
The dataset/harmonization model were created by Mathilde Antoniades when I was helping her to harmonize some PHENOM data. Weirdly, this only happened after trying to save the harmonized data to the dataset (as you can see in the error message, the traceback starts after saving modified data to pickle file
, which means that harmonization had already taken place. I'm not sure why this has happened, but I have the datasets to try and recreate the problem.
I think it is clear why it happens. I datamodel.py
, the age range is set to 25 to 95. If the harmonization model has a smaller age range, it will crash. It only crashes once it tries to show one of the harmonized ROIs. The solution is to set the min and max to the min and max from the harmonization model instead of fixing it at 25 and 95.
Here is where the age range is set: https://github.com/CBICA/NiBAx/blob/185c32f4b74a6b4b96120714f086b00a1da02339/NiBAx/core/model/datamodel.py#L117
The max age can be obtained as follows (from harmonization.py
)
age_max = self.datamodel.harmonization_model['smooth_model']['bsplines_constructor'].knot_kwds[0]['upper_bound']
age_min = self.datamodel.harmonization_model['smooth_model']['bsplines_constructor'].knot_kwds[0]['lower_bound']
I propose to add a function like GetMaxAgeOfMUSEHarmonizationModel()
and GetMinAgeOfMUSEHarmonizationModel()
.
@AbdulkadirA Great thank you for the suggestion! I also figured out that the other issue was due to the fact that this particular dataset included raw derived volumes, so when it came time to 'add the modified data', the list of column names included repeats. It will all make sense in the commit.
age_min = self.datamodel.harmonization_model['smooth_model']['bsplines_constructor'].knot_kwds[0]['lower_bound']
Where would you put these functions? I got the functions to work, but they were defined within the GetNormativeRange function in datamodel.py, which doesn't seem correct
@melhemr I propose to make them members of DataModel
in NiBAx/core/model/datamodel.py
, i.e. same level as GetNormativeRange()
.
@melhemr I propose to make them members of
DataModel
inNiBAx/core/model/datamodel.py
, i.e. same level asGetNormativeRange()
.
When I put them on the same level, the functions appear as not defined (this is the error message that occurs when hovering over the yellow underlined functions)
@melhemr I propose to make them members of
DataModel
inNiBAx/core/model/datamodel.py
, i.e. same level asGetNormativeRange()
.When I put them on the same level, the functions appear as not defined (this is the error message that occurs when hovering over the yellow underlined functions)
@melhemr try calling the function as self.GetMinAgeOfMUSEHarmonizationModel(..)
Using dataset and model supplied by Mathilde Antoniades