Keywords
Medical imaging, DICOM, NIfTI, R package
This article is included in the RPackage gateway.
This article is included in the Bioinformatics gateway.
This article is included in the Neuroconductor collection.
Medical imaging, DICOM, NIfTI, R package
We thank both reviewers for their thoughtful comments and suggestions to improve the manuscript. We have updated the manuscript and published a new package version on CRAN.
Response to Dr. Volker Schmid:
To demonstrate the value of radtools, we have created a new vignette (https://cran.r-project.org/web/packages/radtools/vignettes/oro_compare.html) comparing radtools to existing state-of-the-art tools oro.dicom and oro.nifti, and have summarized this information in the “Use cases” section of the manuscript. The new materials show common questions one may ask when exploring a dataset, such as “Which metadata attributes are present?”, “What are the overall properties of a DICOM acquisition?”, and “What are all metadata properties of a NIfTI image?”, which can be trivially answered with radtools function calls, and are not provided by oro*. Additionally, the vignette demonstrates functionality that is possible with oro* but requires more custom code and in-depth understanding of those packages’ data representations.
Response to Dr. Andrey Fedorov:
We have modified the tests to download 185 of 190 test datasets from the web on the fly, allowing the tests to be run by users and CRAN servers. The only 5 datasets that cannot be downloaded on the fly are those from TCIA, which requires an API key.
We have documented each test dataset and the aspects of the implementation that each is testing as comments in the test files setup-dicomdata.R and setup-niftidata.R; we point to this in the “Implementation” section of the manuscript.
We have added detail to differentiate radtools from oro*. We have created a new vignette (https://cran.r-project.org/web/packages/radtools/vignettes/oro_compare.html) demonstrating the convenience of radtools compared to achieving the same results with oro*, and in several cases, demonstrating useful radtools functionality that is not provided by oro* at all. We summarize this information in a new paragraph in the “Use cases” section of the manuscript.
To read any peer review reports and author responses for this article, follow the "read" links in the Open Peer Review table.
Medical image analysis often lies at the boundary of research and the clinic, presenting challenges in both domains. Institutional and privacy concerns can compete with the objective of open data for research purposes. In particular, it remains standard practice to perform analysis with proprietary software or unpublished scripts. Additionally, the majority of imaging studies do not make image data publically available due to patient privacy requirements. These complex challenges can present barriers for scientists working in the image analysis domain.
In recent years, a small but growing number of open source computational tools have been developed to process and analyze medical images, promoting sharing of code; some of the most widely adopted are described in 1–3. To address the issue of availability of public image data, our group previously developed TCIApathfinder4, an open source R package to simplify access to the thousands of publicly available images in The Cancer Imaging Archive5. Here, we present radtools6, an open source R package that lowers barriers to image analysis by simplifying the extraction of image properties and complex header information. Although several excellent image processing and analysis packages exist for the R environment2,7–10, none currently offers special functionality for convenient presentation of image metadata; these tools generally present metadata in a form closely parallel to its original encoding. Radtools6 specifically addresses the complexity of image metadata, improving upon metadata extraction methods in existing packages. The package implements a layer of processing to convert image metadata to familiar R data structures, eliminating the need for specialized knowledge and custom code to dig into metadata.
Radtools6 supports the two most common medical image formats, DICOM (Digital Imaging and Communication in Medicine)11 and NIfTI-1 (Neuroimaging Informatics Technology Initiative)12. The industry standard DICOM format combines a header and two-dimensional pixel data into one file, so that an image acquisition typically produces multiple DICOM files. (Some valid DICOM objects do not contain pixel data; these are still supported by radtools.) DICOM header fields consist of a “tag” that identifies the attribute, followed by the attribute value. There is no fixed size for a DICOM header; any number of thousands of possible attributes may be included. Each DICOM file for an acquisition contains its own header; many attributes will be constant across image slices. NIfTI-1 format was developed primarily for multidimensional imaging data as an improvement over the previous ANALYZE format13. NIfTI-1 combines header information and the entire multidimensional image acquisition into either a single file or two files (one header file and one image file). Unlike DICOM, NIfTI-1 specifies a particular set of required header attributes, and the header conforms to a fixed size with an option to add extended header information. Radtools6 provides simple functions to explore and return image properties and header data from both image formats in familiar R data structures. For convenience, radtools6 also provides wrappers around existing methods for extraction of pixel data and viewing of image slices.
Radtools6 is provided as a package (extension to the language) for the programming language R. The package is hosted on the Comprehensive R Archive Network (CRAN), and can be installed into the user’s local R environment with the command ‘install.packages(“radtools”)’. The package is loaded into an R session or script with the command ‘library(radtools)’. Radtools consists of a collection of functions that can be called within R scripts or interactively from the R console. Package usage is documented in a vignette that can be viewed on the GitHub page (https://github.com/pamelarussell/radtools), the CRAN page (https://cran.r-project.org/package=radtools), or from the R console with the command ‘browseVignettes(“radtools”)’. The package reference manual provides documentation of each individual function and is available on the CRAN page.
Radtools implements novel functionality for extraction and processing of image metadata. For implementations of the DICOM and NIfTI-1 standards themselves, radtools uses the existing state-of-the-art R packages oro.dicom and oro.nifti2. Radtools builds upon the metadata extraction methods available in those packages, calling their functions under the hood and providing a convenient layer of metadata exploration and processing. In deferring to the implementations in oro.dicom and oro.nifti, radtools is able to process the same file objects supported by those well-developed packages; for files not supported, radtools captures and reports any error messages raised within calls to their functions.
The correctness of our metadata implementations was tested with a diverse collection of 167 DICOM datasets and 23 NIfTI-1 datasets available publically; the tests can be examined and run in the “tests” directory of the package source. Each individual test dataset is documented in code comments.
Radtools6 can extract image properties and header data from any valid DICOM or NIfTI-1 file. Image datasets are loaded with the `read_dicom` and `read_nifti1` functions. Several generic functions extract attributes from either data type, including `img_dimensions`, `num_slices`, `header_fields`, which reports the set of header fields present, and `header_value`, which returns the value(s) of a particular attribute. Additionally, functions are provided to specifically address one format or the other. All header data present in a DICOM acquisition can be extracted into a matrix, where rows are attributes and columns are slices, with the `dicom_header_as_matrix` function. As most DICOM headers contain numerous attributes and many of these are constant across all slices, the `dicom_constant_header_values` function produces a named list of common attributes across slices. NIfTI-specific functions include `nifti1_num_dim`, which returns the number of dimensions, and `nifti1_header_values`, which returns a named list of all metadata attributes for the image.
The image itself can be extracted as a multidimensional matrix of intensities for either file format with `img_data_to_mat`. Image slices can be visualized with `view_slice`.
Finally, functions are provided to explore aspects of the DICOM standard itself. The functions `dicom_all_valid_header_tags`, `dicom_all_valid_header_names`, and `dicom_all_valid_header_keywords` return complete lists of valid DICOM header attributes. The functions `dicom_search_header_names` and `dicom_search_header_keywords` return attributes matching a search term.
For a demonstration of package usage including examples with publically available data, see the package vignette available at https://cran.r-project.org/web/packages/radtools/vignettes/radtools_usage.html.
In an additional vignette available at https://cran.r-project.org/web/packages/radtools/vignettes/oro_compare.html, we demonstrate the value of radtools compared to implementing metadata exploration with oro.dicom and oro.nifti. In some cases, similar results can be achieved by developing an understanding of the data representations in those packages and writing slightly more custom code. In other cases, radtools provides useful methods that are not available in those packages. Functions provided by radtools only include: (1) getting the names of metadata attributes present in a DICOM or NIfTI dataset, (2) getting all NIfTI metadata in a single data structure, (3) getting a data structure containing the overall properties of a DICOM acquisition (attributes that are constant across slices), (4) viewing a DICOM image, and (5) exploring and searching the complex DICOM standard itself.
Radtools6 fills a specific need in the existing ecosystem of R packages for image processing and analysis: namely, the need for convenient extraction of image metadata. The package will accelerate workflow development and provide researchers with easy access to attributes that they may not have otherwise considered using. The inclusion of the package on CRAN, along with clear documentation, make it trivially simple for R users to obtain and begin using radtools.
No data are associated with this article.
Radtools can be installed with the R command “install.packages(“radtools”).
Radtools is available from CRAN: https://cran.r-project.org/package=radtools.
Source code available from: https://github.com/pamelarussell/radtools.
Archived source code at time of publication: https://doi.org/10.5281/zenodo.259317514.
License: MIT License.
This work has been supported by the Grohne-Stapp Endowed Chair for Cancer Research (University of Colorado Cancer Center).
The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Views | Downloads | |
---|---|---|
F1000Research | - | - |
PubMed Central
Data from PMC are received and updated monthly.
|
- | - |
Competing Interests: No competing interests were disclosed.
Reviewer Expertise: Statistical analysis of medical images.
Competing Interests: No competing interests were disclosed.
Reviewer Expertise: medical image computing, imaging informatics, applications of DICOM for implementing FAIR principles in medical image computing
Competing Interests: No competing interests were disclosed.
Reviewer Expertise: statistical analysis of medical images
Competing Interests: No competing interests were disclosed.
Reviewer Expertise: medical image computing, imaging informatics, applications of DICOM for implementing FAIR principles in medical image computing
Is the rationale for developing the new software tool clearly explained?
No
Is the description of the software tool technically sound?
Partly
Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?
Yes
Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?
No
Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?
No
Competing Interests: I am the co-author of the R packages oro.dicom and oro.nifti, which have been used and cited by the authors (however, I am currently not actively developing either package)
Reviewer Expertise: statistical analysis of medical images
Is the rationale for developing the new software tool clearly explained?
No
Is the description of the software tool technically sound?
No
Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others?
Yes
Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool?
Yes
Are the conclusions about the tool and its performance adequately supported by the findings presented in the article?
No
References
1. Whitcher B, Schmid V, Thornton A: Working with the DICOM and NIfTI Data Standards inR. Journal of Statistical Software. 2011; 44 (6). Publisher Full TextCompeting Interests: No competing interests were disclosed.
Reviewer Expertise: medical image computing, imaging informatics, applications of DICOM for implementing FAIR principles in medical image computing
Alongside their report, reviewers assign a status to the article:
Invited Reviewers | ||
---|---|---|
1 | 2 | |
Version 3 (revision) 25 Mar 19 |
read | read |
Version 2 (revision) 25 Jan 19 |
read | read |
Version 1 24 Dec 18 |
read | read |
Provide sufficient details of any financial or non-financial competing interests to enable users to assess whether your comments might lead a reasonable person to question your impartiality. Consider the following examples, but note that this is not an exhaustive list:
Sign up for content alerts and receive a weekly or monthly email with all newly published articles
Already registered? Sign in
The email address should be the one you originally registered with F1000.
You registered with F1000 via Google, so we cannot reset your password.
To sign in, please click here.
If you still need help with your Google account password, please click here.
You registered with F1000 via Facebook, so we cannot reset your password.
To sign in, please click here.
If you still need help with your Facebook account password, please click here.
If your email address is registered with us, we will email you instructions to reset your password.
If you think you should have received this email but it has not arrived, please check your spam filters and/or contact for further assistance.
Comments on this article Comments (0)