SyneRBI / SIRF-Exercises

SIRF Training and demonstration material
http://www.ccpsynerbi.ac.uk
Apache License 2.0
18 stars 21 forks source link

Gradient descent #85

Closed ckolbPTB closed 3 years ago

ckolbPTB commented 3 years ago

I created a notebook which does gradient descent for MR, PET and CT. Somewhere towards the end of the notebook you find the parameter curr_modality which can be set to either mr, pet or ct in order to use the different modalities.

The step-size tau has to be adapted for each modality. Values which I found to work ok, where 0.03 for mr, 0.3 for pet and 0.1 for ct. Would be great if somebody could try it.

KrisThielemans commented 3 years ago

Some suggestions made for moving from as_array + fill + numpy algebra to SIRF algebra.

great. I guess it was based on older examples/notebooks? Maybe the PET notebook still does that (even though the SIRF example doesn't)

ckolbPTB commented 3 years ago

@evgueni-ovtchinnikov Thank you very much for the suggestions to make it more object orientated rather than using numpy arrays. I made all the ammendments except for the check if the data is complex. Here I had to leave the old check on the numpy array, because the CT data does not have the method is_complex().

ckolbPTB commented 3 years ago

I have also tested it on the current SIRF master branch

KrisThielemans commented 3 years ago

great. I haven't checked the updated version yet, but what about making this a bit less "automatic" and let people do it by hand

if not image_data.as_array().dtype in [numpy.complex, numpy.complex64]:

->

if is_MRI:

and have a cell above it setting is_MRI and tell them what to set it.

I think it's less cryptic for an introductory notebook.

ckolbPTB commented 3 years ago

I added a check based on the methodology which is select by the user.

KrisThielemans commented 3 years ago

ready to merge? (we can fine-tune later if need be, but this way it's easier for people to see what it here)