-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom values for brain_phantom #484
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #484 +/- ##
==========================================
- Coverage 90.77% 86.69% -4.08%
==========================================
Files 54 54
Lines 3002 2991 -11
==========================================
- Hits 2725 2593 -132
- Misses 277 398 +121
Flags with carried forward coverage won't be shown. Click here to find out more.
|
I think this is a good idea, but how this is implemented adds too many lines and complexity (you repeat the same code twice). That is why the code coverage fails, as your not adding a test for the other if branch. I would suggest having default values in If the user specifies I think this could be done without adding so many lines. |
Changing from `custom_values` to `tissue_properties`
What do you think about it now? I removed those lines. |
I think the default properties could do something similar to the simulation parameters, and have a default_brain_tissue_properties function. And the user defined parameters are merged to that. As it doesn't make sense to be defined twice (one in 2d and one in 3d). Also it makes more sense that the keys for the dictionary were the tissue names, and that inside you can specify the per tissue properties in some documented order. As the other way around the user needs to remember which tissue was which and it's prone to errors. It will be more verbose but easier to understand, and enable to modify just some tissues. |
Including magnetization states for storing purposes in phantom
Sorry about those last commits, the last one is the good one. In summary, I wrote a |
It looks a lot better now! |
Ok I had to merge another branch before and now this has merge conflicts. Could you solved them so I can merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Apply these last minor suggestions, and I will merge them (some spaces and new lines are being added).
Co-authored-by: Carlos Castillo Passi <[email protected]>
Co-authored-by: Carlos Castillo Passi <[email protected]>
Co-authored-by: Carlos Castillo Passi <[email protected]>
Co-authored-by: Carlos Castillo Passi <[email protected]>
Co-authored-by: Carlos Castillo Passi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just realized that some parts of the code were not completely ok. They are also minor.
Hi @gsahonero when do you think you could finish this? |
Sorry for taking this long. I hope the changes address the requested modifications. |
props = ["ρ", "T1", "T2", "T2s", "Δw"] | ||
Nproperties = length(props) | ||
# Order: CSF, DURA, FAT1, FAT2, GM, MARROW, MUSCLE, SKIN/MUSCLE, SKULL, vESSELS, WM | ||
tissue_labels = [23, 232, 93, 209, 46, 255, 116, 139, 162, 185, 70] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try one last thing?
The sorting and use of tissue_texts
, does not make a lot of sense. It is better if tissue_labels
is also a dictionary (Dict("CSF" => 23, ...)
), and we index it by the default_properties
keys.
You should be able to do:
for i=1:Nproperties
for (tissue, property) in tissue_properties
data_properties[i, :, :, :] += (labels .== tissue_labels[tissue]) * property[i]
end
end
Also, don't forget the spaces between the *
!
It would be useful to be able to change the default values. For example, when dealing with T1 or T2 changes due to different magnetic field strengths.
The changes on
brain_phantom2D
andbrain_phantom3D
allow the user to define the desired values if passed as an argument.