Commit 61746eec authored by Marc Modat's avatar Marc Modat

Minor correction in the intensity scaling of the images (in case scl_slope is set to 0)

parent 79bc94c7
......@@ -378,7 +378,8 @@ int main(int argc, char **argv)
printf("Source image name: %s\n",sourceHeader->fname);
printf("\t%ix%ix%i voxels\n",sourceHeader->nx,sourceHeader->ny,sourceHeader->nz);
printf("\t%gx%gx%g mm\n",sourceHeader->dx,sourceHeader->dy,sourceHeader->dz);
printf("Maximum iteration number: %i\n",param->maxIteration);
printf("Maximum iteration number: %i\n",param->maxIteration);
printf("Percentage of blocks: %i\%\n",param->block_percent_to_use);
#ifdef _USE_CUDA
if(flag->useGPUFlag) printf("The GPU implementation is used\n");
else printf("The CPU implementation is used\n");
......
......@@ -785,6 +785,12 @@ int main(int argc, char **argv)
#endif
printf("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
// nifti_set_filenames(targetImage, "tar.nii.gz", 0, 0);
// nifti_set_filenames(sourceImage, "sou.nii.gz", 0, 0);
// nifti_image_write(targetImage);
// nifti_image_write(sourceImage);
// return 1;
float maxStepSize = (targetImage->dx>targetImage->dy)?targetImage->dx:targetImage->dy;
maxStepSize = (targetImage->dz>maxStepSize)?targetImage->dz:maxStepSize;
float currentSize = maxStepSize;
......
......@@ -71,6 +71,7 @@ void reg_intensityRescale2( nifti_image *image,
break;
}
if(image->scl_slope==0) image->scl_slope=1.0f;
for(unsigned int index=0; index<image->nvox; index++){
DTYPE value = (DTYPE)(*imagePtr++ * image->scl_slope + image->scl_inter);
currentMin=(currentMin<value)?currentMin:value;
......
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