Commit 34e321ab authored by Jamie Mcclelland's avatar Jamie Mcclelland

Fixes

parent 9f55cf12
......@@ -92,7 +92,7 @@ void reg_lncc::UpdateLocalStatImages(nifti_image *originalImage,
reg_tools_multiplyImageToImage(stdDevImage, stdDevImage, stdDevImage);
reg_tools_kernelConvolution(meanImage, this->kernelStandardDeviation, this->kernelType, mask, this->activeTimePoint);
reg_tools_kernelConvolution(stdDevImage, this->kernelStandardDeviation, this->kernelType, mask, this->activeTimePoint);
size_t voxel;
int voxel;
#if defined (NDEBUG) && defined (_OPENMP)
#pragma omp parallel for default(none) \
shared(originalImage, sdevPtr, meanPtr) \
......
......@@ -1675,7 +1675,7 @@ void reg_spline_refineControlPointGrid2D(nifti_image *splineControlPoint,
SplineTYPE *gridPtrX = static_cast<SplineTYPE *>(splineControlPoint->data);
memcpy(oldGrid, gridPtrX, splineControlPoint->nvox*splineControlPoint->nbyper);
if(splineControlPoint->data!=NULL) free(splineControlPoint->data);
int oldDim[3];
int oldDim[4];
oldDim[0]=splineControlPoint->dim[0];
oldDim[1]=splineControlPoint->dim[1];
oldDim[2]=splineControlPoint->dim[2];
......
......@@ -502,9 +502,9 @@ void reg_spline_jacobian3D(nifti_image *splineControlPoint,
union{__m128 m[16];__declspec(align(16)) DTYPE f[64];} basisX;
union{__m128 m[16];__declspec(align(16)) DTYPE f[64];} basisY;
union{__m128 m[16];__declspec(align(16)) DTYPE f[64];} basisZ;
union{__m128 m[16];__declspec(align(16)) DTYPE f[64];} xControlPointCoordinates;
union{__m128 m[16];__declspec(align(16)) DTYPE f[64];} yControlPointCoordinates;
union{__m128 m[16];__declspec(align(16)) DTYPE f[64];} zControlPointCoordinates;
union{__m128 m[16];__declspec(align(16)) DTYPE f[64];} coeffX;
union{__m128 m[16];__declspec(align(16)) DTYPE f[64];} coeffY;
union{__m128 m[16];__declspec(align(16)) DTYPE f[64];} coeffZ;
#else // _WINDOWS
union{__m128 m[4];DTYPE f[16] __attribute__((aligned(16)));} tempX;
union{__m128 m[4];DTYPE f[16] __attribute__((aligned(16)));} tempY;
......
......@@ -936,7 +936,7 @@ void reg_tools_kernelConvolution_core(nifti_image *image,
for(int t=0; t<image->nt*image->nu; t++){
if(timePoint[t]){
DTYPE *intensityPtr = &imagePtr[t * voxelNumber];
size_t index;
int index;
#if defined (_OPENMP)
#pragma omp parallel for default(none) \
shared(densityPtr, intensityPtr, mask, nanImagePtr, voxelNumber) \
......@@ -1003,8 +1003,9 @@ void reg_tools_kernelConvolution_core(nifti_image *image,
#ifndef NDEBUG
printf("[NiftyReg DEBUG] Convolution type[%i] dim[%i] tp[%i] radius[%i] kernelSum[%g]\n", kernelType, n, t, radius, kernelSum);
#endif
unsigned int k, planeIndex, planeNumber, lineIndex, lineOffset;
switch(n){
unsigned int k, planeNumber, lineIndex, lineOffset;
int planeIndex;
switch(n){
case 0:
planeNumber=imageDim[1]*imageDim[2];
lineOffset = 1;
......@@ -1036,7 +1037,7 @@ void reg_tools_kernelConvolution_core(nifti_image *image,
planeNumber,kernelSum) \
private(realIndex,currentIntensityPtr,currentDensityPtr,lineIndex,bufferIntensity, \
bufferDensity,shiftPre,shiftPst,kernelPtr,kernelValue,densitySum,intensitySum, \
k, bufferIntensitycur,bufferDensitycur)
k, bufferIntensitycur,bufferDensitycur, planeIndex)
#endif // _OPENMP
// Loop over the different voxel
for(planeIndex=0; planeIndex<planeNumber; ++planeIndex){
......
......@@ -187,9 +187,9 @@ int main(int argc, char **argv)
float expected;
if(type==0)
expected =
cos(reg_round((float)x/(float)upRatio))*
cos(reg_round((float)y/(float)upRatio))*
cos(reg_round((float)z/(float)upRatio));
cos(float(reg_round((float)x/(float)upRatio)))*
cos(float(reg_round((float)y/(float)upRatio)))*
cos(float(reg_round((float)z/(float)upRatio)));
else expected =
cos((float)x/(float)upRatio)*
cos((float)y/(float)upRatio)*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment