ALL Metrics
-
Views
-
Downloads
Get PDF
Get XML
Cite
Export
Track
Software Tool Article
Revised

Radtools: R utilities for convenient extraction of medical image metadata

[version 2; peer review: 2 not approved]
Previously titled: Radtools: R utilities for smooth navigation of medical image data
PUBLISHED 25 Jan 2019
Author details Author details
OPEN PEER REVIEW
REVIEWER STATUS

This article is included in the RPackage gateway.

This article is included in the Bioinformatics gateway.

This article is included in the Neuroconductor collection.

Abstract

The radiology community has adopted several widely used standards for medical image files, including the popular DICOM (Digital Imaging and Communication in Medicine) and NIfTI (Neuroimaging Informatics Technology Initiative) standards. These file formats include image intensities as well as potentially extensive metadata. The NIfTI standard specifies a particular set of header fields describing the image and minimal information about the scan. DICOM headers can include any of >4,000 available metadata attributes spanning a variety of topics. NIfTI files contain all slices for an image series, while DICOM files capture single slices and image series are typically organized into a directory. Each DICOM file contains metadata for the image series as well as the individual image slice.
The programming environment R is popular for data analysis due to its free and open code, active ecosystem of tools and users, and excellent system of contributed packages. Currently, many published radiological image analyses are performed with proprietary software or custom unpublished scripts. However, R is increasing in popularity in this area due to several packages for processing and analysis of image files. While these R packages handle image import and processing, no existing package makes image metadata conveniently accessible. Extracting image metadata, combining across slices, and converting to useful formats can be prohibitively cumbersome, especially for DICOM files.
We present radtools, an R package for convenient extraction of medical image metadata. Radtools provides simple functions to explore and return metadata in familiar R data structures. For convenience, radtools also includes wrappers of existing tools for extraction of pixel data and viewing of image slices. The package is freely available under the MIT license at https://github.com/pamelarussell/radtools and is easily installable from the Comprehensive R Archive Network (https://cran.r-project.org/package=radtools).

Keywords

Medical imaging, DICOM, NIfTI, R package

Revised Amendments from Version 1

We thank both referees for their thoughtful comments. Overall, both reports identified a lack of clarity around the specific value proposition of radtools, and highlighted the need for further explanation of its relationship to existing tools such as oro.dicom and oro.nifti. We have made several changes to the manuscript and package in light of their suggestions.
Response to specific comments of Dr. Volker Schmid:

  • We have more clearly explained the specific need satisfied by this package that is not provided by existing tools: namely, convenient extraction and exploration of image metadata.
  • We have pointed to the package vignette for examples of usage with publically available data.
Response to specific comments of Dr. Andrey Fedorov:
  • In the “Implementation” section, we have explained the relationship to the existing packages oro.dicom and oro.nifti, and clarified the point that radtools does not reimplement the DICOM and NIfTI formats, but rather defers to oro.dicom and oro.nifti for these implementations.
  • We have provided more details about how the package was tested with available image datasets.
  • We have made a change to the package regarding support for DICOM objects that do not include pixel data such as SR objects. As these objects still contain useful metadata, we have added support for them, and included an SR object in our unit tests. A new release of the package reflecting this change has been published on CRAN and GitHub. We have also added a sentence to the manuscript mentioning this type of valid DICOM object.
  • We have modified the title to be more specific and removed the subjective word “smooth” from the manuscript; the language has been similarly modified in the package description and documentation on CRAN.

To read any peer review reports and author responses for this article, follow the "read" links in the Open Peer Review table.

Introduction

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 13. 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,710, 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.

Methods

Implementation

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 and original source of test objects can be examined in the “tests” directory of the package source.

Operation

The only system requirement is a working installation of R version ≥3.4.0. The radtools workflow consists of calling radtools functions from the R console or within R scripts.

Use cases

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_metadata_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.

Conclusions

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.

Data availability

No data are associated with this article.

Software availability

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.254206914.

License: MIT License.

Comments on this article Comments (0)

Version 3
VERSION 3 PUBLISHED 24 Dec 2018
Comment
Author details Author details
Competing interests
Grant information
Copyright
Download
 
Export To
metrics
Views Downloads
F1000Research - -
PubMed Central
Data from PMC are received and updated monthly.
- -
Citations
CITE
how to cite this article
Russell PH and Ghosh D. Radtools: R utilities for convenient extraction of medical image metadata [version 2; peer review: 2 not approved] F1000Research 2019, 7:1976 (https://doi.org/10.12688/f1000research.17139.2)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
track
receive updates on this article
Track an article to receive email alerts on any updates to this article.

Open Peer Review

Current Reviewer Status: ?
Key to Reviewer Statuses VIEW
ApprovedThe paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approvedFundamental flaws in the paper seriously undermine the findings and conclusions
Version 2
VERSION 2
PUBLISHED 25 Jan 2019
Revised
Views
15
Cite
Reviewer Report 15 Feb 2019
Volker Schmid, Department of Statistics, Ludwig Maximilian University of Munich, Munich, Germany 
Not Approved
VIEWS 15
Unfortunately the authors have revised their manuscript only slightly. I still see a general interest in the aim and the idea of the provided package. However, the value of the package is not explained in the manuscript, and that may be ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Schmid V. Reviewer Report For: Radtools: R utilities for convenient extraction of medical image metadata [version 2; peer review: 2 not approved]. F1000Research 2019, 7:1976 (https://doi.org/10.5256/f1000research.19528.r43610)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
Views
22
Cite
Reviewer Report 12 Feb 2019
Andrey Fedorov, Department of Radiology, Brigham and Women's Hospital, Harvard Medical School,  Boston, MA, USA 
Not Approved
VIEWS 22
Unfortunately, the manuscript is still lacking details about the added value it provides as compared to oro.* packages. The clarification that it provides "convenient extraction and exploration of image metadata", which, according to authors, "is not provided by existing tools", ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Fedorov A. Reviewer Report For: Radtools: R utilities for convenient extraction of medical image metadata [version 2; peer review: 2 not approved]. F1000Research 2019, 7:1976 (https://doi.org/10.5256/f1000research.19528.r43611)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
Version 1
VERSION 1
PUBLISHED 24 Dec 2018
Views
38
Cite
Reviewer Report 07 Jan 2019
Volker Schmid, Department of Statistics, Ludwig Maximilian University of Munich, Munich, Germany 
Not Approved
VIEWS 38
This manuscript describes the R package radtools. The aim of the R package is "smooth navigation of medical image data".

The idea to provide functions which appear "smooth" for the end user is of great importance. However, ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Schmid V. Reviewer Report For: Radtools: R utilities for convenient extraction of medical image metadata [version 2; peer review: 2 not approved]. F1000Research 2019, 7:1976 (https://doi.org/10.5256/f1000research.18738.r42220)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.
Views
42
Cite
Reviewer Report 07 Jan 2019
Andrey Fedorov, Department of Radiology, Brigham and Women's Hospital, Harvard Medical School,  Boston, MA, USA 
Not Approved
VIEWS 42
The authors present a new R package developed to support the use of DICOM and NIfTI files from the R environment. The authors rightfully discuss the popularity of R and the need to support image processing tasks in this environment. ... Continue reading
CITE
CITE
HOW TO CITE THIS REPORT
Fedorov A. Reviewer Report For: Radtools: R utilities for convenient extraction of medical image metadata [version 2; peer review: 2 not approved]. F1000Research 2019, 7:1976 (https://doi.org/10.5256/f1000research.18738.r42221)
NOTE: it is important to ensure the information in square brackets after the title is included in all citations of this article.

Comments on this article Comments (0)

Version 3
VERSION 3 PUBLISHED 24 Dec 2018
Comment
Alongside their report, reviewers assign a status to the article:
Approved - the paper is scientifically sound in its current form and only minor, if any, improvements are suggested
Approved with reservations - A number of small changes, sometimes more significant revisions are required to address specific details and improve the papers academic merit.
Not approved - fundamental flaws in the paper seriously undermine the findings and conclusions
Sign In
If you've forgotten your password, please enter your email address below and we'll send you instructions on how to reset your password.

The email address should be the one you originally registered with F1000.

Email address not valid, please try again

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.

Code not correct, please try again
Email us for further assistance.
Server error, please try again.