Skip to content

NullPOinterException in MiC 3D #3

Description

@biovoxxel

Handing in 2 32-bit image stacks into MiC 3D comparator lead to the following error:

[ERROR] Command errored: Mask instant Comparator 3D java.lang.NullPointerException at fr.curie.mic.MicUtils.checkImagePlus(MicUtils.java:145) at fr.curie.mic.MaskInstantComparator3D.getChoicesFromGD(MaskInstantComparator3D.java:423) at fr.curie.mic.MaskInstantComparator3D.run(MaskInstantComparator3D.java:98) at ij.IJ.runUserPlugIn(IJ.java:244) at ij.IJ.runPlugIn(IJ.java:210) at ij.IJ.runPlugIn(IJ.java:199) at net.imagej.legacy.command.LegacyCommand.run(LegacyCommand.java:57) at org.scijava.command.CommandModule.run(CommandModule.java:196) at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:125) at org.scijava.module.ModuleRunner.call(ModuleRunner.java:64) at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:247) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:750)

Checking MicUtils.java:145 it tries to retrieve the original image info

public static void checkImagePlus(ImagePlus imp){
//IJ.log("image type: "+imp.getFileInfo().fileType);
//IJ.log("image type (original): "+imp.getOriginalFileInfo().fileType);
if(imp.getOriginalFileInfo().fileType== FileInfo.GRAY16_SIGNED){
//IJ.log("correct 16-bit signed");
ImageConverter converter=new ImageConverter(imp);
converter.convertToGray32();
converter.convertToGray16();
}

I think the getOriginalFileInfo can return null if that info is not existent. Therefore, a null check would need to be included at that point before retrieving the image type.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions