Skip to content

Conversation

@paskino
Copy link
Contributor

@paskino paskino commented Jul 3, 2025

"!sed -i.bak \"s/\\r\\([^\\n]\\)/\\r\\n\\1/g\" umap.v.hdr\n",
"# due to https://github.com/UCL/STIR/issues/1601 we copy the data to the working directory which is the same as where the header lives\n",
"! cp $data_path/20170809_NEMA_UCL.n .\n",
"#!sed -i.bak \"s/\\r\\([^\\n]\\)/\\r\\n\\1/g\" umap.v.hdr\n",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why comment this out? It replaces CRLF with LR, which has nothing to do with all the problems you've seen.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also could we ln -s in lieu of cp?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be fine on Unix-type. Not sure about other places. This file is small. I wouldn't bother testing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paskino I think you wanted to comment out

!sed -i.bak2 -e \"s#\\(!name of data file:=\\)#\\\\1{data_path}/#\" umap.v.hdr
!sed -i.bak2 -e \"s#\\(!name of data file:=\\)#\\\\1{data_path}/#\" norm.n.hdr

I still need some convincing that this was your problem though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed a commit... hopefully fine now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not yet. we need to change the line below:

!sed -i.bak2 -e \"s#\\(!name of data file:=\\)#\\\\1{data_path}/#\" norm.n.hdr

Likely we don't need it all, i.e. there probably is no path in the norm.n.hdr (there isn't in my copy). Otherwise, we will need to remove the path (which is a more complicated regexp).

@KrisThielemans KrisThielemans changed the title Update reconstruct_measured_data.ipynb Update reconstruct_measured_data.ipynb for read-only source directory Jul 3, 2025
@KrisThielemans KrisThielemans self-assigned this Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

notebook: reconstruc_measured_data does not work if the data is not in the working directory

4 participants