Slice Geometry: add moment weighting mode option#393
Conversation
|
@JonathanAWilliams thanks! Keep pushing your changes to your branch and let them accumulate here until we're happy that it's done and I can merge the PR. The new drop-down makes the following |
premature, will review all changes once the pr is ready
|
Thanks! Good validtion. Would be good to add them as unit tests, alongside these: https://github.com/bonej-org/BoneJ2/tree/master/Legacy/bonej/src/test/java/org/bonej/plugins Also when testing originally, I did a stack with a rotating rectangular ROI, something like this macro, to test stability under rotation. newImage("Untitled", "8-bit black", 512, 512, 180);
for (i = 0; i < nSlices; i++){
slice = i + 1;
setSlice(slice);
run("Specify...", "width=256 height=128 x=278 y=264 slice="+slice+" centered");
run("Rotate...", " angle="+i);
setForegroundColor(255, 255, 255);
run("Fill", "slice");
run("Select None");
}
run("Slice Geometry", "bone=unknown draw_axes draw_centroids annotated_copy_(2d) process_stack clear_results bone_min=128 bone_max=255 slope=0.0000 y_intercept=1.8000 moment=[Geometric (binary)] background=128 foreground=255"); |
Better to have all the options in one dialog. Multiple dependent dialogs create a headache for macro command harvesting and for headless operation. The old dialog style allows you to grey out options if other options are not active, or they can just be there and have no effect if the parent option is not selected. I don't see your code changes that introduce this option, could you point me to them please? |
























Related to #392
Adds a “Moment weighting” dropdown and enum parsing in Slice Geometry. Default remains geometric (binary), so there is no behaviour change yet—this is scaffolding for the upcoming pixel-weighted (density/partial area) moment calculations.
Next: implement density-weighted centroid + density-weighted integrand