Skip to content

Commit

Permalink
Try bridge then mirror if mirror then bridge cannot be done
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmanton committed Jul 1, 2015
1 parent 4deac44 commit 77915b5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,20 @@ shinyServer(function(input, output) {
if(is.null(tracing_neuron)) return(NULL)
if(input$from != input$to) {
if(input$mirror) {
tracing_neuron <- mirror_brain(tracing_neuron, get(input$from))
tryCatch({
tracing_neuron <- mirror_brain(tracing_neuron, get(input$from))
tracing_neuron <- xform_brain(tracing_neuron, sample=get(input$from), reference=get(input$to))
}, error = function(e) {
tryCatch({
tracing_neuron <- xform_brain(tracing_neuron, sample=get(input$from), reference=get(input$to))
tracing_neuron <- mirror_brain(tracing_neuron, get(input$to))
}, error = function(e) {
stop("Could not mirror neuron.")
})
})
} else {
tracing_neuron <- xform_brain(tracing_neuron, sample=get(input$from), reference=get(input$to))
}
tracing_neuron <- xform_brain(tracing_neuron, sample=get(input$from), reference=get(input$to))
}
tracing_neuron
})
Expand Down

0 comments on commit 77915b5

Please sign in to comment.