-
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
Jupyterhub: reconstruc_measured_data error #120
Comments
This was originally posted in #123 In the PET reconstruct real data notebook we rely on the user to run the script I have therefore pre-run the script and the output is in the same directory of the data (in the read-only filesystem). There’s a cell which I copied here that sets the paths of the various files. #%% set filenames
# input files
list_file = os.path.join(data_path, '20170809_NEMA_60min_UCL.l.hdr')
norm_file = 'norm.n.hdr'
attn_file = 'umap.v.hdr'
# output filename prefixes
sino_file = 'sino'
%ls This cell is presupposing that the users have run the script themselves and the result is in the current working directory. This is not the case in jupyterhub. So what needs doing is either:
In either case the notebook requires some modifications. Which is the preferred solution? I vote for 1. |
see my reply for option 1 in #123 (comment) |
I'll have a look at this tonight in greater detail. But yes, the cells are a little unclear.
despite being labelled "input files", These file names aren't actually used until the cell is run, so the notebook should run fine? It did for me.
|
It should, more explicitly, be like: # input files
list_file = os.path.join(data_path, '20170809_NEMA_60min_UCL.l.hdr')
norm_file = os.path.join(data_path, '20170809_NEMA_UCL.n.hdr'
attn_file = os.path.join(data_path, '20170809_NEMA_MUMAP_UCL.v.hdr'
# converted to STIR format files
norm_conv_file = 'norm.n.hdr'
attn_conv_file = 'umap.v.hdr' and then: !PATH=/opt/SIRF-SuperBuild/INSTALL/bin/:$PATH convertSiemensInterfileToSTIR.sh $norm_file $norm_conv_filr
!PATH=/opt/SIRF-SuperBuild/INSTALL/bin/:$PATH convertSiemensInterfileToSTIR.sh $attn_file $attn_conv_file |
ok. that could work. obviously a pity of the By the way, there is no need to run And by the way, the |
The problem is that the convert script on the jupyterhub instance is not in But, how does it get installed? Apparently one should need to set In none of docker or VM we set In the VM |
UCL/STIR#894. I can't see why it'd be installed on the VM. However, I think the notebook says to try that, so I wouldn't try to fix this now. I don't think we should set |
Can we just add to PATH in the Dockerfile? |
OK, so |
Yes we could, however the kubernetes/jupyterhub configuration is particularly different and |
OK the last bit is that the Adding this at their creation time makes things work sed_cmd = 's#\(!name of data file:=\)#\\1{}/#'.format(data_path)
os.system("cat umap.v.hdr | sed -e '{}' > tmp".format(sed_cmd))
! mv tmp umap.v.hdr
os.system("cat norm.n.hdr | sed -e '{}' > tmp".format(sed_cmd))
! mv tmp norm.n.hdr
! rm tmp |
sigh. I guess we really should have this as part of the minor simplification sed_cmd = 's#\(!name of data file:=\)#\\1{}/#'.format(data_path)
os.system("cat umap.v.hdr | sed -i.bak -e '{}' > tmp".format(sed_cmd))
os.system("cat norm.n.hdr | sed -i.bak -e '{}' > tmp".format(sed_cmd)) Note that Johannes has some neat trick with using |
Sure! I'll do it in my spare time :D |
I'd have just copied the data file, but this saves space I guess! |
Running the
convertSiemensInterfileToSTIR.sh
script one needs to use the following instead of what is in the notebook (the first 2 commented lines)notice that expanding
$data_path
(which is by the way correct) failed for me withInput file is not readable
The text was updated successfully, but these errors were encountered: