You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//assuming uint16, the total memory cost shoudl be approximately (1 + 1 + 1/8 + 2/8 + 2/8) = 2 5/8 original image size in u16bit
106
106
//storage of the particle cell tree for computing the pulling scheme
107
-
MeshData<ImageType> image_temp; // global image variable useful for passing between methods, or re-using memory (should be the only full sized copy of the image)
108
-
MeshData<ImageType> grad_temp; // should be a down-sampled image
109
-
MeshData<float> local_scale_temp; // Used as down-sampled images for some averaging steps where it is useful to not lose precision, or get over-flow errors
110
-
MeshData<float> local_scale_temp2;
111
-
112
107
allocation_timer.start_timer("init and copy image");
113
-
image_temp.init(input_image);
108
+
MeshData<ImageType> image_temp(input_image, false/* don't copy */); // global image variable useful for passing between methods, or re-using memory (should be the only full sized copy of the image)
109
+
MeshData<ImageType> grad_temp; // should be a down-sampled image
MeshData<float> local_scale_temp; // Used as down-sampled images for some averaging steps where it is useful to not lose precision, or get over-flow errors
//offset image by factor (this is required if there are zero areas in the background with uint16_t and uint8_t images, as the Bspline co-efficients otherwise may be negative!)
127
125
// Warning both of these could result in over-flow (if your image is non zero, with a 'buffer' and has intensities up to uint16_t maximum value then set image_type = "", i.e. uncomment the following line)
128
126
float bspline_offset = 0;
129
-
if(std::is_same<uint16_t, ImageType>::value){
127
+
if(std::is_same<uint16_t, ImageType>::value){
130
128
bspline_offset = 100;
131
129
image_temp.copyFromMeshWithUnaryOp(input_image, [=](constauto &a) { return (a + bspline_offset); });
0 commit comments