Skip to content

Commit

Permalink
fixed #1264 (double value returned as float)
Browse files Browse the repository at this point in the history
  • Loading branch information
evgueni-ovtchinnikov committed Jun 20, 2024
1 parent b612958 commit 81f5c0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/xSTIR/cSTIR/cstir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1168,8 +1168,8 @@ cSTIR_objectiveFunctionValue(void* ptr_f, void* ptr_i)
ObjectiveFunction3DF& fun = objectFromHandle< ObjectiveFunction3DF>(ptr_f);
STIRImageData& id = objectFromHandle<STIRImageData>(ptr_i);
Image3DF& image = id.data();
float v = (float)fun.compute_objective_function(image);
return dataHandle<float>(v);
double v = fun.compute_objective_function(image);
return dataHandle<double>(v);
}
CATCH;
}
Expand Down
2 changes: 1 addition & 1 deletion src/xSTIR/pSTIR/STIR.py
Original file line number Diff line number Diff line change
Expand Up @@ -2714,7 +2714,7 @@ def value(self, image):
assert_validity(image, ImageData)
handle = pystir.cSTIR_objectiveFunctionValue(self.handle, image.handle)
check_status(handle)
v = pyiutil.floatDataFromHandle(handle)
v = pyiutil.doubleDataFromHandle(handle)
pyiutil.deleteDataHandle(handle)
return v

Expand Down

0 comments on commit 81f5c0a

Please sign in to comment.