Commit f4754ed3 authored by Jean-Karim Heriche's avatar Jean-Karim Heriche

Fixed image duplication in viewers.

parent 9cc00a1b
......@@ -42,10 +42,10 @@ explore_image_server <-function(input, output, session, rv){
if(!is.null(rv$roiFrame) && rv$roiFrame != "") {
## Figure out what the 3rd dimension is
if(rv$metadataImg1$coreMetadata$sizeZ == 1 && rv$metadataImg1$coreMetadata$sizeT > 1) {
slice.def = list(T = rv$selectedFrame)
slice.def = list(T = unique(rv$selectedFrame))
}
else if(rv$metadataImg1$coreMetadata$sizeZ > 1 && rv$metadataImg1$coreMetadata$sizeT == 1) {
slice.def = list(Z = rv$selectedFrame)
slice.def = list(Z = unique(rv$selectedFrame))
}
}
## Use Bio-Formats to read one image
......
......@@ -26,9 +26,9 @@ explore_image_server2 <-function(input, output, session, rv){
## Deal with eventual Windows-style paths
## Not sure if necessary, not fully tested
rootDir <- file.path(strsplit(rv$imgRoot,'\\\\'))
if(!is.null(rv$imgPath1) && length(unique(rv$imgPath1)) == 1 &&
if(!is.null(rv$imgPath2) && length(unique(rv$imgPath2)) == 1 &&
length(unique(rv$selectedFrame)) <= 1 &&
!is.null(rv$fileCol1) && rv$fileCol1 != ""){
!is.null(rv$fileCol2) && rv$fileCol2 != ""){
rv$imgPath2 <- gsub("[[:space:]]", "", rv$imgPath2)
filePath2 <- file.path(rootDir, strsplit(rv$imgPath2[1], '\\\\'))
validate(need(filePath2 != "" && file.exists(filePath2), "File not found. Check that you selected the correct image root directory."))
......@@ -37,10 +37,10 @@ explore_image_server2 <-function(input, output, session, rv){
if(!is.null(rv$roiFrame) && rv$roiFrame != "") {
## Figure out what the 3rd dimension is
if(rv$metadataImg2$coreMetadata$sizeZ == 1 && rv$metadataImg2$coreMetadata$sizeT > 1) {
slice.def = list(T = rv$selectedFrame)
slice.def = list(T = unique(rv$selectedFrame))
}
else if(rv$metadataImg2$coreMetadata$sizeZ > 1 && rv$metadataImg2$coreMetadata$sizeT == 1) {
slice.def = list(Z = rv$selectedFrame)
slice.def = list(Z = unique(rv$selectedFrame))
}
}
## Use Bio-Formats to read one image
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment