Skip to content

examples/python/Vision_files_preprocess.py: #1593

Merged
KrisThielemans merged 7 commits intoUCL:masterfrom
NicoleJurjew:script_VisionConversion
May 12, 2025
Merged

examples/python/Vision_files_preprocess.py: #1593
KrisThielemans merged 7 commits intoUCL:masterfrom
NicoleJurjew:script_VisionConversion

Conversation

@NicoleJurjew
Copy link
Copy Markdown
Contributor

@NicoleJurjew NicoleJurjew commented May 2, 2025

Added python script to convert e7tools generated sinograms from the Siemens Biograph Vision 600 to STIR-compatible format

Checklist before requesting a review

  • I have performed a self-review of my code
  • [] I have added docstrings/doxygen in line with the guidance in the developer guide
  • [] I have implemented unit tests that cover any new or modified functionality (if applicable)
  • The code builds and runs on my machine
  • documentation/release_XXX.md has been updated with any functionality change (if applicable)

Comment thread documentation/release_6.3.htm Outdated
@KrisThielemans
Copy link
Copy Markdown
Collaborator

@casperdcl could you have a quick look at formatting of comments at the start? Not sure what the recommended way of doing this is. (I'd rather avoid docopt).

Copy link
Copy Markdown
Collaborator

@casperdcl casperdcl left a comment

Choose a reason for hiding this comment

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

If this is the kind of feedback you meant...

Comment thread examples/python/Vision_files_preprocess.py
@KrisThielemans
Copy link
Copy Markdown
Collaborator

Codacy flags up some issues at https://app.codacy.com/gh/UCL/STIR/pull-requests/1593/issues.

  • some unused variables
  • some formatting. Probably best is to do pip install black; black Vision_files_preprocessing.py
  • quite a few warnings about unknown escape sequences. However, the script works... Maybe @casperdcl can recommend something.

Comment thread examples/python/Vision_files_preprocess.py Outdated
Comment thread examples/python/Vision_files_preprocess.py Outdated
Comment thread examples/python/Vision_files_preprocess.py Outdated
Comment thread examples/python/Vision_files_preprocess.py Outdated
Comment thread examples/python/Vision_files_preprocess.py Outdated
Comment thread examples/python/Vision_files_preprocess.py Outdated
Comment thread examples/python/Vision_files_preprocess.py Outdated
Comment thread examples/python/Vision_files_preprocess.py Outdated
Comment thread examples/python/Vision_files_preprocess.py Outdated
Comment thread examples/python/Vision_files_preprocess.py Outdated
@KrisThielemans
Copy link
Copy Markdown
Collaborator

Thanks @casperdcl. These suggestions look good to me. @NicoleJurjew how do you want to do this? Easiest might be to let @casperdcl commit them, and then you try it out (after MIC deadline!). If it doesn't work, we either remove the commit, or fix it...

@NicoleJurjew
Copy link
Copy Markdown
Contributor Author

Hi both,

thanks for your help, I'll have a look at it next week then!

Nicole

@casperdcl
Copy link
Copy Markdown
Collaborator

The remaining issues should be v. easy to fix :)

@NicoleJurjew
Copy link
Copy Markdown
Contributor Author

Hi both,

Thanks for your help, I've fixed most of the codacy issues now.

At first I was surprised by the trailing whitespace issues codacy flagged because I'm using pre-commit, but I'm guessing they occur because there is no rule for python code in the .pre-commit-config.yaml file. I've tried adding it, such that pre-commit fixes my white-space errors automatically:

- repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: - id: trailing-whitespace

But it ended up modifying 468 files across the repo, so I decided not to include it. I'm afraid I don't know how to fix that, but I thought I'd bring it to your attention in case you want to prioritise it.

Nicole

Copy link
Copy Markdown
Collaborator

@KrisThielemans KrisThielemans left a comment

Choose a reason for hiding this comment

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

great. one tiny comment. Please commit with "[ci skip]" in title.

Comment thread examples/python/Vision_files_preprocess.py Outdated
@KrisThielemans
Copy link
Copy Markdown
Collaborator

I've tried adding it, such that pre-commit fixes my white-space errors automatically:

- repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: - id: trailing-whitespace

But it ended up modifying 468 files across the repo, so I decided not to include it. I'm afraid I don't know how to fix that, but I thought I'd bring it to your attention in case you want to prioritise it.

yes, this is on our list. I'm a bit surprised that that particular hook modifies so many files (all C++ files should have been handled already) but fine. As before, I think we will need to create those hooks in 2 stages, such that we can let "git blame" ignore these automatic changes.

thanks!

@KrisThielemans
Copy link
Copy Markdown
Collaborator

By the way, I see VS Code reformatted the html as well. @casperdcl if you know about a good hook for that...

Copy link
Copy Markdown
Collaborator

@KrisThielemans KrisThielemans left a comment

Choose a reason for hiding this comment

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

@casperdcl it's ready to merge for me.

Copy link
Copy Markdown
Collaborator

@casperdcl casperdcl left a comment

Choose a reason for hiding this comment

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

fine by me; depending on your squash/rebase preferences

@KrisThielemans KrisThielemans merged commit bfb4f82 into UCL:master May 12, 2025
@KrisThielemans
Copy link
Copy Markdown
Collaborator

@NicoleJurjew can I delete the branch?

@NicoleJurjew
Copy link
Copy Markdown
Contributor Author

NicoleJurjew commented May 12, 2025 via email

@KrisThielemans KrisThielemans deleted the script_VisionConversion branch May 12, 2025 13:37
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.

3 participants