Commit 42087f11 authored by Michael Spanier's avatar Michael Spanier

fix bad dimensions creation

parent 1015e2a9
Pipeline #21108377 failed with stages
in 5 minutes and 59 seconds
......@@ -224,15 +224,21 @@ static KObject* _reader (const char* filename)
dim = nrrd->dim;
dims = malloc(sizeof(int*) * dim);
dims = malloc(sizeof(int*) * dim + 1);
for (i=0; i<dim; i++) {
dims[i] = nrrd->axis[i].size;
}
dims[dim] = 0;
nrrdimg = kimage_new(type,1,dims);
if (nrrdimg == NULL){
printf ("kimage new failed\n");
return NULL;
}
free(dims);
//read in all the data:
......@@ -250,7 +256,8 @@ static KObject* _reader (const char* filename)
}
dst = (KPixel*)kimage_raw_pixels(nrrdimg);
void* dsttmp = kimage_raw_pixels(nrrdimg);
dst = (KPixel*) dsttmp;
src = nrrd->data;
elementnum = nrrdElementNumber(nrrd);
elementsize = nrrdElementSize(nrrd);
......
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