Skip to content

Commit

Permalink
4D to 2D registration explicitly disallowed for linear reg
Browse files Browse the repository at this point in the history
  • Loading branch information
jonclayden committed Apr 4, 2012
1 parent 03f048b commit bb50744
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions R/niftyreg.R
Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit bb50744

Please sign in to comment.