Skip to content

Update Norm.cu to fix z coordinate in NormBackgroundMonoKernel mask#482

Open
CACNYC wants to merge 1 commit into
warpem:mainfrom
CACNYC:patch-1
Open

Update Norm.cu to fix z coordinate in NormBackgroundMonoKernel mask#482
CACNYC wants to merge 1 commit into
warpem:mainfrom
CACNYC:patch-1

Conversation

@CACNYC

@CACNYC CACNYC commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Use the z loop variable when computing the centered z coordinate for the particle-radius background mask.

Fixes #481 Question about z-coordinate in NormBackgroundMonoKernel background mask

This PR applies a minimal one-line fix in:

NativeAcceleration/gtom/src/ImageManipulation/Norm.cu

Current code in NormBackgroundMonoKernel computes the centered z coordinate as:

int zz = y - dims.z / 2;

Surrounding loop iterates over z, y, and x, and the voxel access uses the actual z index:

tfloat val = d_input[(z * dims.y + y) * dims.x + x];

Proposed radius calculation uses the centered coordinates for all three dimensions:

int zz = z - dims.z / 2;
int yy = y - dims.y / 2;
int xx = x - dims.x / 2;

PR change:

- int zz = y - dims.z / 2;
+ int zz = z - dims.z / 2;

Use the z loop variable when computing the centered z coordinate for the particle-radius background mask.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Question about z-coordinate in NormBackgroundMonoKernel background mask

1 participant