Skip to content

Commit

Permalink
Bugfix for rolling frame filter with all indices out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
sjcross committed May 27, 2024
1 parent 6d2a4c7 commit fbaf9f6
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 5,709 deletions.
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"configurations": [
{
"type": "java",
"name": "CommaSeparatedStringInterpreter",
"request": "launch",
"mainClass": "io.github.mianalysis.mia.process.string.CommaSeparatedStringInterpreter",
"projectName": "mia-algorithms"
},
{
"type": "java",
"name": "MIA_",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import ij.process.ImageProcessor;
import inra.ijpb.morphology.Morphology;
import inra.ijpb.morphology.strel.DiskStrel;
import io.github.mianalysis.mia.MIA;
import io.github.mianalysis.mia.module.Categories;
import io.github.mianalysis.mia.module.Category;
import io.github.mianalysis.mia.module.Module;
Expand Down Expand Up @@ -433,6 +434,10 @@ public static void runRollingFrameFilter(ImagePlus inputImagePlus, String window
frames.add(frame);
}

boolean emptyFrame = frames.size() == 0;
if (emptyFrame)
frames.add(1);

// Creating a local substack and switching T and Z, so time (not Z) is averaged
ImagePlus currentSubstack = SubHyperstackMaker.makeSubhyperstack(tempImagePlus, channels, slices, frames);
currentSubstack = Hyperstack_rearranger.reorderHyperstack(currentSubstack, "CTZ", true, false);
Expand Down Expand Up @@ -469,6 +474,10 @@ public static void runRollingFrameFilter(ImagePlus inputImagePlus, String window
// Switching T and Z back
iplOut = Hyperstack_rearranger.reorderHyperstack(iplOut, "CTZ", true, false);

// If this frame was added in just so there's some content, set all pixels to zero
if (emptyFrame)
ImageMath.process(iplOut,ImageMath.CalculationModes.MULTIPLY,0);

// Adding the new image into outputImagePlus
for (int z = 1; z <= iplOut.getNSlices(); z++) {
for (int c = 1; c <= iplOut.getNChannels(); c++) {
Expand Down
5,709 changes: 0 additions & 5,709 deletions target/site/dependencies.html

This file was deleted.

Binary file removed target/site/images/close.gif
Binary file not shown.
Binary file removed target/site/images/collapsed.gif
Binary file not shown.
Binary file removed target/site/images/expanded.gif
Binary file not shown.
Binary file removed target/site/images/external.png
Binary file not shown.
Binary file removed target/site/images/icon_error_sml.gif
Binary file not shown.
Binary file removed target/site/images/icon_info_sml.gif
Binary file not shown.
Binary file removed target/site/images/icon_success_sml.gif
Binary file not shown.
Binary file removed target/site/images/icon_warning_sml.gif
Binary file not shown.
Binary file removed target/site/images/logos/build-by-maven-black.png
Binary file not shown.
Binary file removed target/site/images/logos/build-by-maven-white.png
Binary file not shown.
Binary file removed target/site/images/logos/maven-feather.png
Binary file not shown.
Binary file removed target/site/images/newwindow.png
Binary file not shown.

0 comments on commit fbaf9f6

Please sign in to comment.