Skip to content
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

fix requirements for plan2sobp #783

Merged
merged 4 commits into from
Jan 2, 2025
Merged

Conversation

grzanka
Copy link
Contributor

@grzanka grzanka commented Dec 10, 2024

To properly install plan2sobp you need to install pymchelper via pipx install pymchelper[dicom] instead of pipx install pymchelper. The last command will install only basic features of the converter, namely conversion to plain text files.

This pull request includes several changes to improve the handling of optional dependencies and enhance the readability of the code. The most important changes include adding error handling for missing dependencies, updating the installation instructions, and improving code formatting.

Error handling for missing dependencies:

Installation instructions:

  • docs/install.rst: Updated the installation instructions to include the plan2sobp program by specifying the pymchelper[dicom] option.

Code formatting improvements:

Dependency updates:

  • setup.py: Updated the dicom extra to include both pydicom and scipy packages.

@grzanka grzanka linked an issue Dec 10, 2024 that may be closed by this pull request
@grzanka grzanka self-assigned this Dec 10, 2024
@grzanka
Copy link
Contributor Author

grzanka commented Dec 10, 2024

Should work now, you can test with this branch state.

root@bc82196b495f:/# pipx install git+https://github.com/DataMedSci/pymchelper@605-missing-pydicom-dependency#egg=pymchelper[dicom]
  installed package pymchelper 2.7.5+rev2, installed using Python 3.11.2
  These apps are now globally available
    - convertmc
    - mcscripter
    - plan2sobp
    - runmc
done! ✨ 🌟 ✨
root@bc82196b495f:/# plan2sobp -h
usage: plan2sobp [-h] [-b beam_model.csv] [-i] [-x] [-y] [-f FIELD_NR] [-d] [-n] [-s SCALE] [-c COLS] [-v] [-V] input_file [output_file]

positional arguments:
  input_file            path to input file in IBA '.pld'-format or Varian DICOM-RN.
  output_file           path to the SHIELD-HIT12A/FLUKA output_file. Default: 'sobp.dat'

options:
  -h, --help            show this help message and exit
  -b beam_model.csv     optional input beam model in commasparated CSV format
  -i, --flip            flip XY axis of input (x -> y and y -> x)
  -x, --xflip           flip x axis of input (x -> -x)
  -y, --yflip           flip y axis of input (y -> -y)
  -f FIELD_NR, --field FIELD_NR
                        select which field to export, for dicom files holding several fields. '0' will produce multiple output files with a running number.
  -d, --diag            print diagnostics of input dicom file, but do not export data
  -n, --nominal         save nominal energies instead of beam model energies
  -s SCALE, --scale SCALE
                        number of particles*dE/dx per MU
  -c COLS, --columns COLS
                        number of columns in output file. 5, 6, 7 col format supported, default is 7.
  -v, --verbosity       increase output verbosity
  -V, --version         show program's version number and exit
root@bc82196b495f:/# 

@grzanka grzanka changed the title fix reqs fix requirements for plan2sobp Dec 10, 2024
@grzanka grzanka requested a review from nbassler December 10, 2024 10:43
@grzanka grzanka enabled auto-merge (squash) December 10, 2024 11:47
@grzanka grzanka disabled auto-merge January 2, 2025 08:52
@grzanka grzanka merged commit 353e06c into master Jan 2, 2025
14 checks passed
@grzanka grzanka deleted the 605-missing-pydicom-dependency branch January 2, 2025 08:52
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.

missing pydicom dependency
1 participant