Skip to content

Commit

Permalink
COMP: Another attempt at passing travis.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntustison committed Jul 10, 2019
1 parent a373d0b commit 5be87a8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions R/extractImagePatches.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
#' maskImage <- getMask( image, 1, 1000 )
#' patchSet1 <- extractImagePatches( image, c( 32, 32 ), 10, c( 32, 32 ), randomSeed = 0 )
#' patchSet2 <- extractImagePatches( image, c( 32, 32 ), 10, c( 32, 32 ), randomSeed = 1 )
#' # patchSet3 <- extractImagePatches( image, c( 32, 32 ), 10, c( 32, 32 ), maskImage, randomSeed = 0 )
#' patchSet3 <- extractImagePatches( image, c( 32, 32 ), 10, c( 32, 32 ), maskImage, randomSeed = 0 )
#'
#' @export
extractImagePatches <- function( image, patchSize, maxNumberOfPatches = 'all',
strideLength = 1, maskImage = NA, randomSeed, returnAsArray = FALSE )
strideLength = 1, maskImage = NULL, randomSeed, returnAsArray = FALSE )
{
if ( ! missing( randomSeed ) )
{
Expand Down Expand Up @@ -185,7 +185,7 @@ extractImagePatches <- function( image, patchSize, maxNumberOfPatches = 'all',
randomIndices <-
array( data = NA, dim = c( maxNumberOfPatches, dimensionality ) )

if( !is.na( maskImage ) )
if( !is.null( maskImage ) )
{
maskArray <- as.array( maskImage )
maskArray[which( maskArray != 0 )] <- 1
Expand Down
10 changes: 5 additions & 5 deletions R/randomlyTransformImageData.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ randomlyTransformImageData <- function( referenceImage,
for( i in seq_len( numberOfSimulations ) )
{
singleSubjectImageList <- inputImageList[[randomIndices[i]]]
singleSubjectSegmentationImage <- NA
if( !is.na( segmentationImageList[[1]] ) )
singleSubjectSegmentationImage <- NULL
if( ! is.null( segmentationImageList[[1]] ) )
{
singleSubjectSegmentationImage <- segmentationImageList[[randomIndices[i]]]
}
Expand All @@ -182,7 +182,7 @@ randomlyTransformImageData <- function( referenceImage,
singleSubjectImageList[[j]], referenceImage,
interpType = inputImageInterpolator )
}
if( !is.na( singleSubjectSegmentationImage ) )
if( ! is.null( singleSubjectSegmentationImage ) )
{
singleSubjectSegmentationImage <- resampleImageToTarget(
singleSubjectSegmentationImage, referenceImage,
Expand Down Expand Up @@ -223,15 +223,15 @@ randomlyTransformImageData <- function( referenceImage,
}
simulatedImageList[[i]] <- singleSubjectSimulatedImageList

if( !is.na( singleSubjectSegmentationImage ) )
if( ! is.null( singleSubjectSegmentationImage ) )
{
simulatedSegmentationImageList[[i]] <- applyAntsrTransform( transforms,
singleSubjectSegmentationImage, referenceImage,
interpolation = segmentationImageInterpolator )
}
}

if( is.na( segmentationImageList[[1]] ) )
if( is.null( segmentationImageList[[1]] ) )
{
return( list( simulatedImageList = simulatedImageList ) )
}
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/extractImagePatches.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/extractImagePatches.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5be87a8

Please sign in to comment.