open-dicom / csa_header Goto Github PK
View Code? Open in Web Editor NEWParse Siemens CSA header information
License: MIT License
Parse Siemens CSA header information
License: MIT License
pip
update is suddenly raising an exception in #11.
Worth implementing a data store with Pooch or similar? For example, on lines of : https://github.com/nipraxis/nipraxis/blob/main/nipraxis/_fetcher.py
Then you could do something like this in the README:
import csa_header
# Fetch example DICOM file from data repository.
eg_fname = csa_header.data.fetch_file('an_example.dcm')
dcm = pydicom.dcmread(eg_fname)
or the tests:
def test_something():
eg_fname = csa_header.data.fetch_file('an_example.dcm')
eg_dcm = pydicom.dcmread(eg_fname)
raw_csa = eg_dcm.get((0x29, 0x1020)).value
parsed_csa = CsaHeader(raw_csa).read()
assert (parsed_csa['NumberOfPrescans' ==
{'index': 1, 'VR': 'IS', 'VM': 1, 'value': 0})
Issue a Zenodo DOI after a first release and add to the README.
Am I right in thinking that the index
elements in a CSA header are always sequential?
For example, from the README:
{
'NumberOfPrescans': {'index': 1, 'VR': 'IS', 'VM': 1, 'value': 0},
'TransmitterCalibration': {'index': 2, 'VR': 'DS', 'VM': 1, 'value': 247.102},
'PhaseGradientAmplitude': {'index': 3, 'VR': 'DS', 'VM': 1, 'value': 0.0},
'ReadoutGradientAmplitude': {'index': 4, 'VR': 'DS', 'VM': 1, 'value': 0.0},
'SelectionGradientAmplitude': {'index': 5, 'VR': 'DS', 'VM': 1, 'value': 0.0},
...
}
Are these index
entries necessary? I realize they are in the CSA header structure, but, given Python dictionary insertion order, does:
indices = [v['index'] for k, v in parsed_csa.items()]
ever differ from np.arange(len(parsed_csa))
?
I'd like to include csa_header
in my package (to parse CSA headers, obviously) but cannot do so because there is no pypi release. The alternative is to install (it's parent?) dicom_parser
, but that has more dependencies and seems to be behind in terms of commits to the csa lib. What's the status of this project, is it a fork of dicom_parser
? Is it still actively developed, i.e. is there a pypi release planned?
Nibabel has a get_csa_header
function : https://github.com/nipy/nibabel/blob/master/nibabel/nicom/csareader.py#L31
It implements the logic of finding the image
or series
CSA header from the DICOM file. I see from that file that there is logic for finding where the relevant private elements start: https://github.com/nipy/nibabel/blob/master/nibabel/nicom/utils.py#L7. . So, for example, instead of doing this:
raw_csa = dcm.get((0x29, 0x1020)).value
CsaHeader(raw_csa).read()
you can do this:
get_csa_header(dcm, 'image')
Following the suggestion made by @matthew-brett in #11, it would be good to integrate doctests.
Following #16, pooch
should be integrated to support fetching test files from dicom-gallery
repositories.
Where should this repo sit in relationship to Nibabel or pydicom? Should it be an optional dependency? Won't that mean that lots of DICOM libraries could have this as an optional dependency?
Currently, it is inconsistent between 3.7+ and 3.9+.
Add CONTRIBUTING
and CODE_OF_CONDUCT
files.
Test coverage should be greater than 90%.
It might be convenient to move NiBabel's summary of CSA headers, as well as any other useful information, to this repository's Wiki tab (I think a complete Sphinx setup might be a bit of an overkill, happy to discuss).
hatch run lint:typing
to run successfully.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.