substack from composite image stack

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

substack from composite image stack

Guenter Giese
Dear list members,

Is there a command / macro to generate substacks from composite images
(8bit, 12bit, 16bit) by just entering the desired substack start/end plane
numbers?

The commands / plugins found under Image>Stacks>Manipulation work well with
single channel or RGB images. However, a composite images stack seems to be
treated like an interleaved one-channel stack presenting the total number of
single channel planes to the menus, and not the number of composite planes
displayed in the composite stack viewer.  

As a workaround, one may deinterleave the stack, crop each one-channel stack
and recombine the stacks again to generate a composite stack. But this is a
bit cumbersome and error-prone.


Best,

Guenter
Reply | Threaded
Open this post in threaded view
|

BeanShell in Fiji

Norbert Vischer-2
I need to develop some beanshell scripts for MicroManager, and I want to pepare this in Fiji. However, starting the "Script Editor", none of the languages work, and even if I type in rubbish, no errors occur, only the messages like

        Started New_.bsh at Mon Nov 15 15:33:52 CET 2010

This happens on java 1.6.0_20(32 bit); (Macbook Pro 32 bit)

I have updated Fiji today-

regards, Norbert
Reply | Threaded
Open this post in threaded view
|

Re: BeanShell in Fiji

Volker Baecker
Hello Norbert,
I have no mac, so I can't test. On my ubuntu it works.
Try the line

ij.IJ.log("Hello");

and run it (with beanshell as language). It should open the ImageJ
log-window.
Volker

On 15/11/10 16:05, Norbert Vischer wrote:
> I need to develop some beanshell scripts for MicroManager, and I want to pepare this in Fiji. However, starting the "Script Editor", none of the languages work, and even if I type in rubbish, no errors occur, only the messages like
>
> Started New_.bsh at Mon Nov 15 15:33:52 CET 2010
>
> This happens on java 1.6.0_20(32 bit); (Macbook Pro 32 bit)
>
> I have updated Fiji today-
>
> regards, Norbert
Reply | Threaded
Open this post in threaded view
|

Re: BeanShell in Fiji

dscho
In reply to this post by Norbert Vischer-2
Hi,

On Mon, 15 Nov 2010, Norbert Vischer wrote:

> I need to develop some beanshell scripts for MicroManager, and I want to
> pepare this in Fiji. However, starting the "Script Editor", none of the
> languages work, and even if I type in rubbish, no errors occur, only the
> messages like
>
> Started New_.bsh at Mon Nov 15 15:33:52 CET 2010
>
> This happens on java 1.6.0_20(32 bit); (Macbook Pro 32 bit)
>
> I have updated Fiji today-

This problem was noticed by Aryeh at the scripting workshop in Luxembourg,
and Wayne himself diagnosed it to be a problem when the ImageJ daily
build was used instead of the ImageJA in Fiji.

I fixed it; please update. The scripting editor will look a little bit
different than before, because it gained new functionality (for example
separate output areas for separate scripts, thanks to Albert Cardona).

Ciao,
Dscho
Reply | Threaded
Open this post in threaded view
|

Re: BeanShell in Fiji

Aryeh Weiss
In reply to this post by Norbert Vischer-2
On 11/15/10 5:05 PM, Norbert Vischer wrote:

> I need to develop some beanshell scripts for MicroManager, and I want
> to pepare this in Fiji. However, starting the "Script Editor", none
> of the languages work, and even if I type in rubbish, no errors
> occur, only the messages like
>
> Started New_.bsh at Mon Nov 15 15:33:52 CET 2010
>
> This happens on java 1.6.0_20(32 bit); (Macbook Pro 32 bit)
>
> I have updated Fiji today-
>
> regards, Norbert

This problem occurred at the ImageJ2010 workshop. It was caused
(apparently) by using the ImageJ ij.jar, instead of the ImageJA ij.jar.
If you go the the Fiji updater , use teh advanced mode, and select
locally modified plugins, you will find ij.jar listed. If so, select it
and then update it. This should solve your scripting problem, but you
will not be using the latest ij.jar (which may be fine, if the most
recent changes are not required in your applications).

--aryeh
--
Aryeh Weiss
School of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051
Reply | Threaded
Open this post in threaded view
|

Re: substack from composite image stack

Albert Cardona-2
In reply to this post by Guenter Giese
2010/11/15 Guenter Giese <[hidden email]>:

> Dear list members,
>
> Is there a command / macro to generate substacks from composite images
> (8bit, 12bit, 16bit) by just entering the desired substack start/end plane
> numbers?
>
> The commands / plugins found under Image>Stacks>Manipulation work well with
> single channel or RGB images. However, a composite images stack seems to be
> treated like an interleaved one-channel stack presenting the total number of
> single channel planes to the menus, and not the number of composite planes
> displayed in the composite stack viewer.
>
> As a workaround, one may deinterleave the stack, crop each one-channel stack
> and recombine the stacks again to generate a composite stack. But this is a
> bit cumbersome and error-prone.


In Fiji, you could write a jython script like:


from ij import IJ, ImagePlus, ImageStack

def extractChannel(imp, nChannel, nFrame):
  """ Extract a stack for a specific color channel and time frame """
  stack = imp.getImageStack()
  ch = ImageStack(imp.width, imp.height)
  for i in range(1, imp.getNSlices() + 1):
    index = imp.getStackIndex(nChannel, i, nFrame)
    ch.addSlice(str(i), stack.getProcessor(index))
  return ImagePlus("Channel " + str(nChannel), ch)

imp = IJ.getImage()
extractChannel(imp, 1, 1).show()


Save is as "extract_channel.py" under the plugins folder, and run
"Help - Update Menus" or restart Fiji.

Launch it like any other plugin (including the command finder).

Albert


--
http://albert.rierol.net
Reply | Threaded
Open this post in threaded view
|

Re: BeanShell in Fiji

Aryeh Weiss
In reply to this post by Aryeh Weiss
Look like the latest Fiji update fixes this. I am now running ij.jar
version 1.44k1. Following the latest Fiji update, Beanshell and Python
started working.

--aryeh


On 11/15/10 7:12 PM, Aryeh Weiss wrote:

> On 11/15/10 5:05 PM, Norbert Vischer wrote:
>> I need to develop some beanshell scripts for MicroManager, and I want
>> to pepare this in Fiji. However, starting the "Script Editor", none
>> of the languages work, and even if I type in rubbish, no errors
>> occur, only the messages like
>>
>> Started New_.bsh at Mon Nov 15 15:33:52 CET 2010
>>
>> This happens on java 1.6.0_20(32 bit); (Macbook Pro 32 bit)
>>
>> I have updated Fiji today-
>>
>> regards, Norbert
>
> This problem occurred at the ImageJ2010 workshop. It was caused
> (apparently) by using the ImageJ ij.jar, instead of the ImageJA ij.jar.
> If you go the the Fiji updater , use teh advanced mode, and select
> locally modified plugins, you will find ij.jar listed. If so, select it
> and then update it. This should solve your scripting problem, but you
> will not be using the latest ij.jar (which may be fine, if the most
> recent changes are not required in your applications).
>
> --aryeh


--
Aryeh Weiss
School of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051