PYDICOM-CODIFY(1)
π PYDICOM-CODIFY π
okay bestie, listen. you know that thing where you have a DICOM file and you desperately need the pydicom (Python) code that would build that exact file from scratch? yeah. that's this. pydicom-codify reads a DICOM file and spits out the pydicom Python code that can create that file. it's giving reverse-engineering but make it cute. β¨
πΈ SYNOPSIS πΈ
pydicom codify [-h] [-e EXCLUDE_SIZE] [-p] [-s SAVE_AS] filespec [outfile]
π OPTIONS π
β¨ POSITIONAL ARGUMENTS β¨
filespecβ the file spec, and she has range. the format is[pydicom::]filename[::element]. if you put thepydicom::prefix in front, it grabs the pydicom test file with that name. if you hand her anelement, she uses only that one data element inside the file. no cap. π
Examples, copy these exactly bestie:
path/to/your_file.dcm
your_file.dcm::StudyDate
pydicom::rtplan.dcm::BeamSequence[0]
yourplan.dcm::BeamSequence[0].BeamNumber
outfileβ the filename to write the Python code into. and if you don't give her one? the code just goes straight to stdout, right there in your terminal, main character behaviour. π«Ά
π OPTIONAL ARGUMENTS π
-h,--helpβ show a help message and dip. the classic. π-e EXCLUDE_SIZE,--exclude-size EXCLUDE_SIZEβ excludes binary data bigger than whatever you specify. the default is100bytes, so anything chunkier than that gets ghosted. π-p,--include-privateβ includes private data elements. the default is to exclude them, so if you want them you gotta ask. π-s SAVE_AS,--save-as SAVE_ASβ sets the filename used inds.save_as(save_filename). if you don't pick one, she just uses your input name +_from_codify. iconic. π
π NOTES π
real talk, important stuff here:
- Binary data (like, say, pixels πΌοΈ) that's larger than
--exclude-size(default100bytes) is not included. instead you get a dummy line with a syntax error. yes, a syntax error, on purpose, so you notice. π - Private data elements are not included by default. that's what
-pis for.
π SEE ALSO π
okay that's the whole vibe. go forth and codify, bestie. you're literally the moment. π β¨
this has been PYDICOM-CODIFY(1), from the September 2024 era β stan a classic. ππ¦ bye pookie!! π«Ά
π¦ where this page comes from
- fedora 43: python3-pydicom 3.0.1-12.fc43 Β· MIT and BSD-3-Clause
- fedora 43: python3-pydicom 3.0.2-1.fc43 Β· MIT and BSD-3-Clause
- fedora 44: python3-pydicom 3.0.1-13.fc44 Β· MIT and BSD-3-Clause
- fedora 44: python3-pydicom 3.0.2-1.fc44 Β· MIT and BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms