-
Notifications
You must be signed in to change notification settings - Fork 22
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
Suggestions for MAPEM and reconstruct_measured_data #140
Conversation
@@ -254,7 +254,7 @@ | |||
"# Implement MAP-EM!\n", | |||
"Actually, we will implement MAP-OSEM as that's easy to do.\n", | |||
"\n", | |||
"The lines below (almost) implement MAP-OSEM with a prior which just smooths along the horizontal direction. Either evaluate, and/or extend to 2D, and/or increase the speed of your Python code.\n", | |||
"The lines below (almost) implement MAP-OSEM with a prior which just smooths along the horizontal direction.\n", |
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.
I'm not convinced that the current compute_xreg
would actually be made much faster by tweaking the implementation - and the use of jit would make it unpredictable. I don't know if its a good idea to suggest that the participants try to optimise it.
Extending to 2D is a good suggestion, but its already below in the "what now?" section
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.
ok!
@@ -292,7 +294,7 @@ | |||
"cell_type": "markdown", | |||
"metadata": {}, | |||
"source": [ | |||
"We will use the \"Just In Time\" compilation feature if `numba` here to speed-up the following function. (There are faster ways to write it, but this might be easier to understand)." | |||
"We will use the \"Just In Time\" (jit) compilation feature of `numba` here to speed-up the following function." |
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.
Again, I'm not sure that this actually is that slow. I think jit
would have every reason to be able to optimise this well.
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.
sure
"# This command prepends the data path to the data file so that the header in our working folder points to the data\n", | ||
"# You likely won't need to do this for your own data if the data file is in the same directory.\n", | ||
"!sed -i.bak2 -e \"s#\\(!name of data file:=\\)#\\\\1${data_path}/#\" umap.v.hdr\n", | ||
"!sed -i.bak2 -e \"s#\\(!name of data file:=\\)#\\\\1${data_path}/#\" norm.v.hdr\n", |
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.
All this sed
ing is probably already confusing to the reader.
I've made the two sed
lines more similar to one-another rather that confusingly using jupyter commands on the first one and os.system calls on the second
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.
I'm assuming you checked it still worked ok?
Of course, they can be combined in1, but that probably doesn't help the user.
could add a note that this is needed due to limitations of the current convert*
scripts in STIR if you think that'd help
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.
Yes, tested.
this is needed due to limitations of the current convert* scripts
Well normally you'd run this and still have the file in the same directory - I don't think we'd want the convert*
scripts to convert to absolute files (makes a pain for network directories, moving data, etc.) anyway. So I think the current comment communicates that
"# Advanced: if you'd like to have a look at what changed in the umap, uncomment below\n", | ||
"# Lines starting with < are the original Siemens\n", | ||
"# and lines starting with > are the STIR converted\n", | ||
"# !diff $data_path/20170809_NEMA_MUMAP_UCL.v.hdr umap.v.hdr" |
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.
This is probably quite interesting to participants who are familiar enough with diff
@@ -129,7 +137,7 @@ | |||
"metadata": {}, | |||
"outputs": [], | |||
"source": [ | |||
"!cp $SIRF_PATH/../STIR/scripts/IO/convertSiemensInterfileToSTIR.sh $SIRF_INSTALL_PATH/bin" | |||
"# !cp $SIRF_PATH/../STIR/scripts/IO/convertSiemensInterfileToSTIR.sh $SIRF_INSTALL_PATH/bin" |
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.
Comment it out so that users with trigger-happy fingers don't run it unnecessarily (although it will be needed for the course)
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.
interesting, is it going to fail on JupyterHub (and docker) due to read-only location? Better to write it in the current dir?
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.
Hmmm.. I don't have JupyterHub account to test. Can you give me one?
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.
But I think that can be a separate issue
"# is what we need to muliply by to correct for attenuation, while we computed the attenuation\n", | ||
"# factors above, which is how much attenuation is estimated.\n", | ||
"# Fortunately, these are simply the inverse.\n", | ||
"acf_factors = attn_factors.get_uniform_copy()\n", |
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.
Not sure if readers will be familiar with the ACF/AF nomenclature?
@@ -254,7 +254,7 @@ | |||
"# Implement MAP-EM!\n", | |||
"Actually, we will implement MAP-OSEM as that's easy to do.\n", | |||
"\n", | |||
"The lines below (almost) implement MAP-OSEM with a prior which just smooths along the horizontal direction. Either evaluate, and/or extend to 2D, and/or increase the speed of your Python code.\n", | |||
"The lines below (almost) implement MAP-OSEM with a prior which just smooths along the horizontal direction.\n", |
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.
ok!
"# This command prepends the data path to the data file so that the header in our working folder points to the data\n", | ||
"# You likely won't need to do this for your own data if the data file is in the same directory.\n", | ||
"!sed -i.bak2 -e \"s#\\(!name of data file:=\\)#\\\\1${data_path}/#\" umap.v.hdr\n", | ||
"!sed -i.bak2 -e \"s#\\(!name of data file:=\\)#\\\\1${data_path}/#\" norm.v.hdr\n", |
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.
I'm assuming you checked it still worked ok?
Of course, they can be combined in1, but that probably doesn't help the user.
could add a note that this is needed due to limitations of the current convert*
scripts in STIR if you think that'd help
@@ -129,7 +137,7 @@ | |||
"metadata": {}, | |||
"outputs": [], | |||
"source": [ | |||
"!cp $SIRF_PATH/../STIR/scripts/IO/convertSiemensInterfileToSTIR.sh $SIRF_INSTALL_PATH/bin" | |||
"# !cp $SIRF_PATH/../STIR/scripts/IO/convertSiemensInterfileToSTIR.sh $SIRF_INSTALL_PATH/bin" |
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.
interesting, is it going to fail on JupyterHub (and docker) due to read-only location? Better to write it in the current dir?
Co-authored-by: Kris Thielemans <KrisThielemans@users.noreply.github.com>
done? |
Yes, with two spin-off issues |
No description provided.