From: Simon Rit Date: Tue, 23 Aug 2011 17:16:48 +0000 (+0200) Subject: Limit uniformity test to first 3 dimensions (usually the spatial ones) X-Git-Tag: v1.3.0~240^2^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=607ef9091246c288b0a1333e87d3d31ce7ee5cd7;p=clitk.git Limit uniformity test to first 3 dimensions (usually the spatial ones) to avoid problems when spacing was randomly assigned in 4th dimension --- diff --git a/common/clitkXdrImageIOReader.cxx b/common/clitkXdrImageIOReader.cxx index b9380a2..07384ef 100644 --- a/common/clitkXdrImageIOReader.cxx +++ b/common/clitkXdrImageIOReader.cxx @@ -700,11 +700,13 @@ int clitk::XdrImageIO::ReadImageInformationWithError() SetOrigin(i,10*p[0]); //Test if rectilinear image is actually uniform (tolerance 0.1 mm) - for (j=0; j0.1) { - free(points); - fclose(fstream); - return ER_NOT_HANDLED; + if(i<3) { // Only for first 3 dimensions because spacing is barely used in other dims + for (j=0; j0.1) { + free(points); + fclose(fstream); + return ER_NOT_HANDLED; + } } } p += (int)GetDimensions(i);