diff --git a/.github/workflows/cmake-linux.yml b/.github/workflows/cmake-linux.yml index 15a758d3..370759c8 100644 --- a/.github/workflows/cmake-linux.yml +++ b/.github/workflows/cmake-linux.yml @@ -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" \ diff --git a/.github/workflows/cmake-macos.yml b/.github/workflows/cmake-macos.yml index 8b302c08..0e078ff7 100644 --- a/.github/workflows/cmake-macos.yml +++ b/.github/workflows/cmake-macos.yml @@ -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 "*-*" - --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 "*-*" \ + --exit-success-if-missing-token --token ${{ secrets.GA_TOKEN }} diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c614e01..d8c95bc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}") diff --git a/README.md b/README.md index c8409436..45ba8854 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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. diff --git a/libsrc/ImageSEGConverter.cpp b/libsrc/ImageSEGConverter.cpp index 1e386b11..b19b381f 100644 --- a/libsrc/ImageSEGConverter.cpp +++ b/libsrc/ImageSEGConverter.cpp @@ -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(); @@ -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()){ @@ -505,6 +507,7 @@ namespace dcmqi { pair , string> ImageSEGConverter::dcmSegmentation2itkimage(DcmDataset *segDataset, const bool mergeSegments) { DcmSegmentation *segdoc = NULL; + // Make sure RLE-compressed images can be decompressed DcmRLEDecoderRegistration::registerCodecs(); diff --git a/libsrc/ParaMapConverter.cpp b/libsrc/ParaMapConverter.cpp index a82ff317..ef8da16f 100644 --- a/libsrc/ParaMapConverter.cpp +++ b/libsrc/ParaMapConverter.cpp @@ -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; }