|
a |
|
b/RadETL/R/imageResolutionColumns_ImageTable.R |
|
|
1 |
#' 'imageResolutionColumns' |
|
|
2 |
#' |
|
|
3 |
#' imageResolutionColumns function will resolution(especially columns) of each images |
|
|
4 |
#' |
|
|
5 |
#' |
|
|
6 |
#' @param DICOMList you can put it like this and then run the function : DICOMList<-DICOMHeaderList(DICOMFolderPath) |
|
|
7 |
#' @import dplyr |
|
|
8 |
#' @importFrom magrittr "%>%" |
|
|
9 |
#' |
|
|
10 |
#' |
|
|
11 |
#' @return A list containing resolution(especially columns) of each DICOM images |
|
|
12 |
#' @examples |
|
|
13 |
#' DICOMList<-DICOMHeaderList(DICOMFolderPath) |
|
|
14 |
#' imageResolutionColumns(DICOMList) |
|
|
15 |
#' @export |
|
|
16 |
|
|
|
17 |
imageResolutionColumns<-function(DICOMList){ |
|
|
18 |
imageResolutionColumns<-lapply(DICOMList, function(x){ |
|
|
19 |
imageResolutionColumns<-as.character(x[[1]] %>% dplyr::filter(name=='Columns') %>% dplyr::select(value)) |
|
|
20 |
if(imageResolutionColumns=="character(0)" | imageResolutionColumns=="" | imageResolutionColumns=="integer(0)"){ |
|
|
21 |
imageResolutionColumns='NA' |
|
|
22 |
} |
|
|
23 |
return(imageResolutionColumns) |
|
|
24 |
}) |
|
|
25 |
imageResolutionColumns<-as.data.frame(do.call(rbind, imageResolutionColumns)) |
|
|
26 |
colnames(imageResolutionColumns)<-'imageResolutionColumns' |
|
|
27 |
return(imageResolutionColumns) |
|
|
28 |
} |