Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Read Dicom Headers in KNIME
library(tidyverse)
library(oro.dicom)
knime.in$Location %>%
plyr::ldply(function(in_path) {
readDICOMFile(as.character(in_path), pixelData = F)$hdr %>%
group_by(name) %>% summarize_all(funs(first)) %>% # remove duplicate names
select(name, value) %>% spread(name, value) %>% # reformat as a table
head(1)
}
) -> all_header
cbind(knime.in, all_header) -> knime.out
# knime complains about duplicate columns
names(knime.out)<-make.unique(names(knime.out))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.