ImageJ macro - montage to stack

I had this working before, on images with 1 channel. However now my image has 3 channels, since I worked around the image cropper problem. Now all of a sudden the Macro doesnt run anymore. Following errors are produced:

 

2016-03-04 13:49:04,124 : DEBUG : Run$_KNIME-Worker-191 : ImageJ Macro : ImageJ Macro : 2:9 : Execute failed: java.lang.IllegalArgumentException: Interval must fit into src in SubsetViews.subsetView(...)
java.lang.RuntimeException: java.lang.IllegalArgumentException: Interval must fit into src in SubsetViews.subsetView(...)
    at org.knime.knip.base.node.ValueToCellNodeModel$1.getCells(ValueToCellNodeModel.java:399)
    at org.knime.knip.base.node.ValueToCellNodeModel.execute(ValueToCellNodeModel.java:525)
    at org.knime.knip.imagej1.IJMacroNodeFactory$1.execute(IJMacroNodeFactory.java:194)
    at org.knime.core.node.NodeModel.executeModel(NodeModel.java:563)
    at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1146)
    at org.knime.core.node.Node.execute(Node.java:933)
    at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:556)
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
    at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
    at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
    at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:328)
    at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:204)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
    at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Caused by: java.lang.IllegalArgumentException: Interval must fit into src in SubsetViews.subsetView(...)
    at net.imglib2.ops.operation.SubsetOperations.subsetview(SubsetOperations.java:172)
    at org.knime.knip.imagej1.IJMacroNodeFactory$1.compute(IJMacroNodeFactory.java:299)
    at org.knime.knip.imagej1.IJMacroNodeFactory$1.compute(IJMacroNodeFactory.java:1)
    at org.knime.knip.base.node.ValueToCellNodeModel$1.getCells(ValueToCellNodeModel.java:376)
    ... 15 more

I tried to run a splitter after the segment cropper, but this gave the same error message. So probably the segment  cropper is the culprit.

In the ImageJ macro node, did you select all the dimensions that you'd like to process? When you tried with 1-channel images before, you probably had only X and Y selected in the dimension selector. Did you try selecting Channel as well?

 

There are no channels to select.

You said you're working with 3 channel images now.

What I meant was activating the Channel button in the Dimension Selection of the Macro node:

But maybe I'm misunderstanding your issue. Can you post an example workflow and image reproducing the problem?

 

The workflow including images is too large for me to upload. Could you send me your mail adres that I can send it to you?

There is no way "Montage to Stack" will work in the ImageJ Macro node, since it requires the input image and the result image to have the same dimensions. The "Montage to Stack" command will however inevitably add an additional dimension (stack) to your image, and in addition will change its x and y range.

You can however achieve what you want with KNIME Image Processing without requiring ImageJ macros. I'll follow up with a small example workflow soon.

Jan

 

Hi Jan,

I had it working before. So I know that it is possible, althought after changing my workflow I forgot to save an old version, so I have to rethink how it was working :)

I build a quick new workflow. Just add an image and run it.

Ok, I'm surprised that it works like that. But the problem might be that when you go to multiple channels and have a hyperstack within ImageJ, "Montage to Stack" will not work...

Anyhow, I attached a workflow avoiding ImageJ 1.x macros altogether. Maybe it helps for your project.

 

Have a nice weekend,

Jan

 

Looks wonderfull, thanks a lot!

Have a nice weekend as well.

 

Luuk