Skip to content

Commit

Permalink
Merge branch 'master' into merged-segments
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelonken authored Nov 1, 2023
2 parents 3c3df73 + 2b3c928 commit 1f136ca
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 14 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/cmake-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,24 @@ jobs:
cd docker && make dcmqi.test
- name: "Publish docker image"
# Only run if the event is not a pull request and the repository owner is QIICR.
# The latter is to prevent forks from publishing packages even if the owner's token
# would have sufficient privileges.
if: ${{ (github.event_name != 'pull_request') && (github.repository_owner == 'QIICR')}}
run: |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASS }} && \
docker push fedorov/dcmqi:`git describe --tags --exact-match 2> /dev/null || echo "latest"` \
|| echo "skipping docker push"
- name: "Publish linux package"
# Only run if the event is not a pull request and the repository owner is QIICR.
# The latter is to prevent forks from publishing packages even if the owner's token
# would have sufficient privileges.
if: ${{ (github.event_name != 'pull_request') && (github.repository_owner == 'QIICR')}}
run: |
pip install -U "scikit-ci-addons>=0.22.0"
# python -m scikit-ci publish --package-name dcmqi --package-version `git
# describe --tags --exact-match 2> /dev/null || echo "latest"` --platform linux
# python -m scikit-ci publish --package-name dcmqi --package-version `git
# describe --tags --exact-match 2> /dev/null || echo "latest"` --platform linux
# --commit-range ${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }} --repository ${{ github.event.pull_request.head.repo.full_name }} --token ${{ secrets.GITHUB_TOKEN }} --verbose
ci_addons publish_github_release QIICR/dcmqi \
--prerelease-packages "build/dcmqi-build/dcmqi-*-linux-*.tar.gz" \
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/cmake-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,23 @@ jobs:
# ...and finally package it.
- name: "Package dcmqi"
# Only run if the event is not a pull request and the repository owner is QIICR.
# The latter is to prevent forks from publishing packages even if the owner's token
# would have sufficient privileges.
if: ${{ (github.event_name != 'pull_request') && (github.repository_owner == 'QIICR')}}
run: |
cd ${{ github.workspace }}/dcmqi-build/dcmqi-build && ninja package
- name: Publish package
# Only run if the event is not a pull request and the repository owner is QIICR.
# The latter is to prevent forks from publishing packages even if the owner's token
# would have sufficient privileges.
if: ${{ (github.event_name != 'pull_request') && (github.repository_owner == 'QIICR')}}
run: |
pip install -U "scikit-ci-addons>=0.22.0"
ci_addons publish_github_release qiicr/dcmqi
--exit-success-if-missing-token
--prerelease-packages "${{ github.workspace }}/dcmqi-build/dcmqi-build/dcmqi-*-mac-*.tar.gz"
--prerelease-packages-clear-pattern "dcmqi-*-mac-*" --prerelease-packages-keep-pattern "*<COMMIT_DATE>-<COMMIT_SHORT_SHA>*"
--token ${{ secrets.GA_TOKEN }}
ci_addons publish_github_release QIICR/dcmqi \
--prerelease-packages ${{ github.workspace }}/dcmqi-build/dcmqi-build/dcmqi-*-mac-*.tar.gz \
--prerelease-packages-clear-pattern "dcmqi-*-mac-*" \
--prerelease-packages-keep-pattern "*<COMMIT_DATE>-<COMMIT_SHORT_SHA>*" \
--exit-success-if-missing-token --token ${{ secrets.GA_TOKEN }}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ endforeach()
#
set(DCMQI_VERSION_MAJOR 1)
set(DCMQI_VERSION_MINOR 2)
set(DCMQI_VERSION_PATCH 5)
set(DCMQI_VERSION_PATCH 6)
set(DCMQI_VERSION
"${DCMQI_VERSION_MAJOR}.${DCMQI_VERSION_MINOR}.${DCMQI_VERSION_PATCH}")

Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

dcmqi (DICOM (**dcm**) for Quantitative Imaging (**qi**)) is a collection of libraries and command line tools with minimum dependencies to support standardized communication of [quantitative image analysis](http://journals.sagepub.com/doi/pdf/10.1177/0962280214537333) research data using [DICOM standard](https://en.wikipedia.org/wiki/DICOM).

Specifically, the current focus of development for dcmqi is to support conversion of the following data types to and from DICOM:
Specifically, dcmqi can help you with the conversion of the following data types to and from DICOM:
* voxel-based segmentations using [DICOM Segmentation IOD](http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_A.51.html)
* parametric maps using [DICOM Parametric map IOD](http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_A.75.html)
* image-based measurements using [DICOM Structured Reporting (SR) template TID1500](http://dicom.nema.org/medical/dicom/current/output/chtml/part16/chapter_A.html#sect_TID_1500)
Expand All @@ -19,7 +19,7 @@ As an introduction to the motivation, capabilities and advantages of using the D

> Fedorov A, Clunie D, Ulrich E, Bauer C, Wahle A, Brown B, Onken M, Riesmeier J, Pieper S, Kikinis R, Buatti J, Beichel RR. (2016) DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research. *PeerJ* 4:e2057 https://doi.org/10.7717/peerj.2057
dcmqi is developed and maintained by the [QIICR](http://qiicr.org) project.
dcmqi is developed and maintained by the [NCI Imaging Data Commons](https://imaging.datacommons.cancer.gov) project.

# Getting started

Expand Down Expand Up @@ -47,10 +47,16 @@ To acknowledge dcmqi in an academic paper, please cite
If you like dcmqi, please give the dcmqi repository [a star on github](https://help.github.com/articles/about-stars/). This is an easy way to show thanks and it can help us qualify for useful services that are only open to widely recognized open projects.

This work is supported primarily by the National Institutes of Health, National Cancer Institute, [Informatics Technology for Cancer Research (ITCR) program](https://itcr.nci.nih.gov/), grant [Quantitative Image Informatics for Cancer Research (QIICR)](http://qiicr.org) (U24 CA180918, PIs Kikinis and Fedorov). We also acknowledge support of the following grants: [Neuroimage Analysis Center (NAC)](http://nac.spl.harvard.edu/) (P41 EB015902, PI Kikinis) and [National Center for Image Guided Therapy (NCIGT)](http://ncigt.org) (P41 EB015898, PI Tempany).
This project has been supported in part by the following funded initiatives:
* [National Cancer Institute Imaging Data Commons (IDC)](https://imaging.datacommons.cancer.gov) project, funded in whole or in part with Federal funds from the National Cancer Institute, National Institutes of Health, under Task Order No. HHSN26110071 under Contract No. HHSN261201500003l
* National Institutes of Health, National Cancer Institute, [Informatics Technology for Cancer Research (ITCR) program](https://itcr.nci.nih.gov/), grant [Quantitative Image Informatics for Cancer Research (QIICR)](http://qiicr.org) (U24 CA180918, PIs Kikinis and Fedorov)
* [Neuroimage Analysis Center (NAC)](http://nac.spl.harvard.edu/) (P41 EB015902, PI Kikinis)
* [National Center for Image Guided Therapy (NCIGT)](http://ncigt.org) (P41 EB015898, PI Tempany)

# References

1. Fedorov A, Clunie D, Ulrich E, Bauer C, Wahle A, Brown B, Onken M, Riesmeier J, Pieper S, Kikinis R, Buatti J, Beichel RR. (2016) _DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research._ *PeerJ* 4:e2057 https://doi.org/10.7717/peerj.2057
1. Fedorov, A., Longabaugh, W. J. R., Pot, D., Clunie, D. A., Pieper, S., Aerts, H. J. W. L., Homeyer, A., Lewis, R., Akbarzadeh, A., Bontempi, D., Clifford, W., Herrmann, M. D., Höfener, H., Octaviano, I., Osborne, C., Paquette, S., Petts, J., Punzo, D., Reyes, M., Schacherer, D. P., Tian, M., White, G., Ziegler, E., Shmulevich, I., Pihl, T., Wagner, U., Farahani, K. & Kikinis, R. NCI Imaging Data Commons. Cancer Res. 81, 4188–4193 (2021). https://dx.doi.org/10.1158/0008-5472.CAN-21-0950

2. Herz C, Fillion-Robin J-C, Onken M, Riesmeier J, Lasso A, Pinter C, Fichtinger G, Pieper S, Clunie D, Kikinis R, Fedorov A. _dcmqi: An Open Source Library for Standardized Communication of Quantitative Image Analysis Results Using DICOM_. *Cancer Research*. 2017;77(21):e87–e90 http://cancerres.aacrjournals.org/content/77/21/e87.
2. Fedorov A, Clunie D, Ulrich E, Bauer C, Wahle A, Brown B, Onken M, Riesmeier J, Pieper S, Kikinis R, Buatti J, Beichel RR. (2016) _DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research._ *PeerJ* 4:e2057 https://doi.org/10.7717/peerj.2057

3. Herz C, Fillion-Robin J-C, Onken M, Riesmeier J, Lasso A, Pinter C, Fichtinger G, Pieper S, Clunie D, Kikinis R, Fedorov A. _dcmqi: An Open Source Library for Standardized Communication of Quantitative Image Analysis Results Using DICOM_. *Cancer Research*. 2017;77(21):e87–e90 http://cancerres.aacrjournals.org/content/77/21/e87.
5 changes: 4 additions & 1 deletion libsrc/ImageSEGConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ namespace dcmqi {
ImageSOPInstanceReferenceMacro &instRef = srcimgItems[0]->getImageSOPInstanceReference();
OFString instanceUID;
CHECK_COND(instRef.getReferencedSOPClassUID(classUID));
CHECK_COND(instRef.getReferencedSOPInstanceUID(instanceUID));
CHECK_COND(instRef.getReferencedSOPInstanceUID(instanceUID))cpp;

if(instanceUIDs.find(instanceUID) == instanceUIDs.end()){
SOPInstanceReferenceMacro *refinstancesItem = new SOPInstanceReferenceMacro();
Expand Down Expand Up @@ -440,6 +440,8 @@ namespace dcmqi {
}

std::cout << "Writing DICOM segmentation dataset " << std::endl;
// Don't check functional groups since its very time consuming and we trust
// ourselves to put together valid datasets
segdoc->setCheckFGOnWrite(OFFalse);
OFCondition writeResult = segdoc->writeDataset(segdocDataset);
if(writeResult.bad()){
Expand Down Expand Up @@ -505,6 +507,7 @@ namespace dcmqi {
pair <map<unsigned,ShortImageType::Pointer>, string> ImageSEGConverter::dcmSegmentation2itkimage(DcmDataset *segDataset, const bool mergeSegments) {
DcmSegmentation *segdoc = NULL;


// Make sure RLE-compressed images can be decompressed
DcmRLEDecoderRegistration::registerCodecs();

Expand Down
4 changes: 4 additions & 0 deletions libsrc/ParaMapConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,10 @@ namespace dcmqi {
pMapDoc->getSeries().setSeriesNumber(metaInfo.getSeriesNumber().c_str());

DcmDataset* output = new DcmDataset();

// Don't check functional groups since its very time consuming and we trust
// ourselves to put together valid datasets
pMapDoc->getFunctionalGroups().setCheckOnWrite(OFFalse);
CHECK_COND(pMapDoc->writeDataset(*output));
return output;
}
Expand Down

0 comments on commit 1f136ca

Please sign in to comment.