Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter.dog breaks with an UnsignedByteType input and a FloatType output #656

Open
gselzer opened this issue Oct 12, 2023 · 1 comment
Open
Assignees
Labels

Comments

@gselzer
Copy link
Contributor

gselzer commented Oct 12, 2023

I feel like the following should work, as a user, but it doesn't. May be an Ops issue, just filing it here because this is where I'm seeing it.

  1. Run `filter.dog(img "out"?, img "in", number "sigma1", number "sigma2", outOfBoundsFactory "fac"?) -> (img "out"?)
  2. in -> the bricks sample image
  3. 2 as sigma1
  4. 5 as sigma2
  5. Create a new image of type float32 as the output image
  6. Click Run
  7. See the following error:
java.lang.ClassCastException: net.imglib2.type.numeric.integer.UnsignedByteType cannot be cast to net.imglib2.type.numeric.real.FloatType
	at net.imglib2.type.numeric.real.FloatType.sub(FloatType.java:56)
	at net.imagej.ops.math.IIToIIOutputII$Subtract.compute(IIToIIOutputII.java:181)
	at net.imagej.ops.math.IIToIIOutputII$Subtract.compute(IIToIIOutputII.java:137)
	at net.imagej.ops.special.hybrid.BinaryHybridCI1.mutate(BinaryHybridCI1.java:61)
	at net.imagej.ops.special.hybrid.BinaryHybridCFI1.mutate(BinaryHybridCFI1.java:75)
	at net.imagej.ops.special.hybrid.BinaryHybridCI1.run(BinaryHybridCI1.java:70)
	at net.imagej.ops.special.hybrid.BinaryHybridCFI1.run(BinaryHybridCFI1.java:65)
	at net.imagej.ops.special.hybrid.BinaryHybridCFI.run(BinaryHybridCFI.java:68)
	at net.imagej.ops.special.hybrid.BinaryHybridCFI.run(BinaryHybridCFI.java:75)
	at org.scijava.command.CommandModule.run(CommandModule.java:196)
	at net.imagej.ops.OpEnvironment.run(OpEnvironment.java:960)
	at net.imagej.ops.OpEnvironment.run(OpEnvironment.java:157)
	at net.imagej.ops.filter.dog.DefaultDoG.compute(DefaultDoG.java:94)
	at net.imagej.ops.filter.dog.DefaultDoG.compute(DefaultDoG.java:54)
	at net.imagej.ops.special.chain.UHCFViaUHCF.compute(UHCFViaUHCF.java:63)
	at net.imagej.ops.filter.dog.DoGSingleSigmas.compute(DoGSingleSigmas.java:98)
	at net.imagej.ops.filter.dog.DoGSingleSigmas.compute(DoGSingleSigmas.java:54)
	at net.imagej.ops.special.hybrid.UnaryHybridCF.run(UnaryHybridCF.java:75)
	at net.imagej.ops.special.hybrid.UnaryHybridCF.run(UnaryHybridCF.java:97)
	at org.scijava.command.CommandModule.run(CommandModule.java:196)
	at net.imagej.ops.OpEnvironment.run(OpEnvironment.java:960)
	at net.imagej.ops.OpEnvironment.run(OpEnvironment.java:136)
	at net.imagej.ops.OpListingModule.run(OpListingModule.java:68)
	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)
@gselzer gselzer added the bug label Oct 12, 2023
@gselzer gselzer self-assigned this Oct 12, 2023
@gselzer gselzer transferred this issue from imagej/napari-imagej Oct 14, 2024
@gselzer
Copy link
Contributor Author

gselzer commented Oct 14, 2024

This is in fact an issue with imagej-ops: see here, where the input and output images must be the same type. Of course, this is really an issue in the Op matcher, where this Op shouldn't even match!

However, I don't see why we couldn't fix the Op to cover more cases...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant