Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

4D to 2D registration explicitly disallowed for linear reg

  • Loading branch information...
commit bb50744a287085816bf95c1cb1823ae5ac8b4738 1 parent 03f048b
@jonclayden authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 R/niftyreg.R
View
6 R/niftyreg.R
@@ -52,8 +52,8 @@ niftyreg.linear <- function (source, target, targetMask = NULL, initAffine = NUL
report(OL$Error, "Only 2D, 3D or 4D source images may be used")
if (!(target@dim_[1] %in% c(2,3)))
report(OL$Error, "Only 2D or 3D target images may be used")
- if (length(dim(source)) - length(dim(target)) > 1)
- report(OL$Error, "The source image may not have more than one extra dimension")
+ if (source@dim_[1] == 4 && target@dim_[1] == 2)
+ report(OL$Error, "4D to 2D registration cannot be performed")
if (any(dim(source) < 4) || any(dim(target) < 4))
report(OL$Error, "Images of fewer than 4 voxels in any dimension cannot be registered")
if (!is.null(targetMask) && !is.nifti(targetMask))
@@ -161,8 +161,6 @@ niftyreg.nonlinear <- function (source, target, targetMask = NULL, initAffine =
report(OL$Error, "Only 2D or 3D target images may be used")
if (source@dim_[1] == 4 && target@dim_[1] == 2)
report(OL$Error, "4D to 2D registration cannot be performed")
- if (length(dim(source)) - length(dim(target)) > 1)
- report(OL$Error, "The source image may not have more than one extra dimension")
if (!is.null(targetMask) && !is.nifti(targetMask))
report(OL$Error, "Target mask must be NULL or a \"nifti\" object")
if (any(sapply(list(nLevels,maxIterations,nBins,bendingEnergyWeight,jacobianWeight,finalInterpolation,verbose), length) != 1))
Please sign in to comment.
Something went wrong with that request. Please try again.