|
a |
|
b/RadETL/R/imageSliceThickness_ImageTable.R |
|
|
1 |
#' 'imageSliceThickness' |
|
|
2 |
#' |
|
|
3 |
#' imageSliceThickness function indicates slice thickness(distance) between each images taken by CT |
|
|
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 indicating slice thickness(distance) between each images taken by CT |
|
|
12 |
#' @examples |
|
|
13 |
#' DICOMList<-DICOMHeaderList(DICOMFolderPath) |
|
|
14 |
#' imageSliceThickness(DICOMList) |
|
|
15 |
#' @export |
|
|
16 |
|
|
|
17 |
imageSliceThickness<-function(DICOMList){ |
|
|
18 |
imageSliceThickness<-lapply(DICOMList, function(x){ |
|
|
19 |
imageSliceThickness<-as.character(x[[1]] %>% dplyr::filter(name =='SliceThickness') %>% dplyr::select(value)) |
|
|
20 |
if(imageSliceThickness=="character(0)" | imageSliceThickness=="" | imageSliceThickness=="integer(0)"){ |
|
|
21 |
imageSliceThickness='NA' |
|
|
22 |
} |
|
|
23 |
return(imageSliceThickness)}) |
|
|
24 |
imageSliceThickness<-as.data.frame(do.call(rbind, imageSliceThickness)) |
|
|
25 |
colnames(imageSliceThickness)<-'imageSliceThickness' |
|
|
26 |
return(imageSliceThickness) |
|
|
27 |
} |