'ops not defined' when running jython script

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

'ops not defined' when running jython script

Brian Northan
Hi List

A couple of things...

1.  The last couple of days when I try to extract the Fiji Linux 64 continuous release tar file I get an error "truncated gzip input".  I can work around this by downloading the "all platforms" package instead.

2.  It seems that the ops service is not getting injected into my jython scripts.  Scripts works fine (ie data and display are injuected) until I try to call an op.  Then I get "ops is not defined".   This only happens when using a Fiji release.  If I run imagej2 through a development environment using maven it works.

Thanks, an example script is below

Brian

# @DatasetService data
# @DisplayService display
# @OpService ops

# define a local directory to get the images from
directory="/home/bnorthan/Brian2014/Images/TempForEasyAccess/"

# use 2-channels of the lena image for test image
image1Name="lena_red.tif"
image2Name="lena_green.tif"

# open first image
image1=data.open(directory+image1Name)
display.createDisplay(image1.getName(), image1);   

# open second image
image2=data.open(directory+image2Name)
display.createDisplay(image2.getName(), image2);

# add the images
image3 = ops.add(image1,image2)
display.createDisplay(image3.getName(), image3)




_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: 'ops not defined' when running jython script

Curtis Rueden
Hi Brian,

Thanks for the reports:

> 1.  The last couple of days when I try to extract the Fiji Linux 64
> continuous release tar file I get an error "truncated gzip input".  I can
> work around this by downloading the "all platforms" package instead. 

Hmm, I did not see this problem when I tried just now. Perhaps the download itself is not completing successfully? It should be ~141MB. If it keeps happening, we could add an MD5 sum for verification if that would be helpful.

> 2.  It seems that the ops service is not getting injected into my jython
> scripts.  Scripts works fine (ie data and display are injuected) until I try
> to call an op.  Then I get "ops is not defined".   This only happens when
> using a Fiji release.  If I run imagej2 through a development environment
> using maven it works. 

Yeah, I noticed this same problem the other day, and fixed it on master:


Using scijava-common-2.28.0 or later will avoid the issue. Or you can work around it by writing:

    # @net.imagej.ops.OpService ops

Regards,
Curtis


On Mon, Aug 4, 2014 at 3:32 PM, Brian Northan <[hidden email]> wrote:
Hi List

A couple of things...

1.  The last couple of days when I try to extract the Fiji Linux 64 continuous release tar file I get an error "truncated gzip input".  I can work around this by downloading the "all platforms" package instead.

2.  It seems that the ops service is not getting injected into my jython scripts.  Scripts works fine (ie data and display are injuected) until I try to call an op.  Then I get "ops is not defined".   This only happens when using a Fiji release.  If I run imagej2 through a development environment using maven it works.

Thanks, an example script is below

Brian

# @DatasetService data
# @DisplayService display
# @OpService ops

# define a local directory to get the images from
directory="/home/bnorthan/Brian2014/Images/TempForEasyAccess/"

# use 2-channels of the lena image for test image
image1Name="lena_red.tif"
image2Name="lena_green.tif"

# open first image
image1=data.open(directory+image1Name)
display.createDisplay(image1.getName(), image1);   

# open second image
image2=data.open(directory+image2Name)
display.createDisplay(image2.getName(), image2);

# add the images
image3 = ops.add(image1,image2)
display.createDisplay(image3.getName(), image3)




_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel



_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: 'ops not defined' when running jython script

Brian Northan
Hi Curtis

Thanks, it worked perfectly - btw I doubled posted on the fiji list as I figured this question might be of interest to any fiji users trying out the new scripting.

Brian


On Mon, Aug 4, 2014 at 5:06 PM, Curtis Rueden <[hidden email]> wrote:
Hi Brian,

Thanks for the reports:

> 1.  The last couple of days when I try to extract the Fiji Linux 64
> continuous release tar file I get an error "truncated gzip input".  I can
> work around this by downloading the "all platforms" package instead. 

Hmm, I did not see this problem when I tried just now. Perhaps the download itself is not completing successfully? It should be ~141MB. If it keeps happening, we could add an MD5 sum for verification if that would be helpful.

> 2.  It seems that the ops service is not getting injected into my jython
> scripts.  Scripts works fine (ie data and display are injuected) until I try
> to call an op.  Then I get "ops is not defined".   This only happens when
> using a Fiji release.  If I run imagej2 through a development environment
> using maven it works. 

Yeah, I noticed this same problem the other day, and fixed it on master:


Using scijava-common-2.28.0 or later will avoid the issue. Or you can work around it by writing:

    # @net.imagej.ops.OpService ops

Regards,
Curtis


On Mon, Aug 4, 2014 at 3:32 PM, Brian Northan <[hidden email]> wrote:
Hi List

A couple of things...

1.  The last couple of days when I try to extract the Fiji Linux 64 continuous release tar file I get an error "truncated gzip input".  I can work around this by downloading the "all platforms" package instead.

2.  It seems that the ops service is not getting injected into my jython scripts.  Scripts works fine (ie data and display are injuected) until I try to call an op.  Then I get "ops is not defined".   This only happens when using a Fiji release.  If I run imagej2 through a development environment using maven it works.

Thanks, an example script is below

Brian

# @DatasetService data
# @DisplayService display
# @OpService ops

# define a local directory to get the images from
directory="/home/bnorthan/Brian2014/Images/TempForEasyAccess/"

# use 2-channels of the lena image for test image
image1Name="lena_red.tif"
image2Name="lena_green.tif"

# open first image
image1=data.open(directory+image1Name)
display.createDisplay(image1.getName(), image1);   

# open second image
image2=data.open(directory+image2Name)
display.createDisplay(image2.getName(), image2);

# add the images
image3 = ops.add(image1,image2)
display.createDisplay(image3.getName(), image3)




_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel




_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: 'ops not defined' when running jython script

Brian Northan
Regarding the download problem.  The download is 141 MB.  So something must be wrong with my archive manager set up.  I'll have to figure it out.  It handles zip fine but not tar.


On Mon, Aug 4, 2014 at 5:14 PM, Brian Northan <[hidden email]> wrote:
Hi Curtis

Thanks, it worked perfectly - btw I doubled posted on the fiji list as I figured this question might be of interest to any fiji users trying out the new scripting.

Brian


On Mon, Aug 4, 2014 at 5:06 PM, Curtis Rueden <[hidden email]> wrote:
Hi Brian,

Thanks for the reports:

> 1.  The last couple of days when I try to extract the Fiji Linux 64
> continuous release tar file I get an error "truncated gzip input".  I can
> work around this by downloading the "all platforms" package instead. 

Hmm, I did not see this problem when I tried just now. Perhaps the download itself is not completing successfully? It should be ~141MB. If it keeps happening, we could add an MD5 sum for verification if that would be helpful.

> 2.  It seems that the ops service is not getting injected into my jython
> scripts.  Scripts works fine (ie data and display are injuected) until I try
> to call an op.  Then I get "ops is not defined".   This only happens when
> using a Fiji release.  If I run imagej2 through a development environment
> using maven it works. 

Yeah, I noticed this same problem the other day, and fixed it on master:


Using scijava-common-2.28.0 or later will avoid the issue. Or you can work around it by writing:

    # @net.imagej.ops.OpService ops

Regards,
Curtis


On Mon, Aug 4, 2014 at 3:32 PM, Brian Northan <[hidden email]> wrote:
Hi List

A couple of things...

1.  The last couple of days when I try to extract the Fiji Linux 64 continuous release tar file I get an error "truncated gzip input".  I can work around this by downloading the "all platforms" package instead.

2.  It seems that the ops service is not getting injected into my jython scripts.  Scripts works fine (ie data and display are injuected) until I try to call an op.  Then I get "ops is not defined".   This only happens when using a Fiji release.  If I run imagej2 through a development environment using maven it works.

Thanks, an example script is below

Brian

# @DatasetService data
# @DisplayService display
# @OpService ops

# define a local directory to get the images from
directory="/home/bnorthan/Brian2014/Images/TempForEasyAccess/"

# use 2-channels of the lena image for test image
image1Name="lena_red.tif"
image2Name="lena_green.tif"

# open first image
image1=data.open(directory+image1Name)
display.createDisplay(image1.getName(), image1);   

# open second image
image2=data.open(directory+image2Name)
display.createDisplay(image2.getName(), image2);

# add the images
image3 = ops.add(image1,image2)
display.createDisplay(image3.getName(), image3)




_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel





_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: 'ops not defined' when running jython script

Curtis Rueden
Hi Brian,

> So something must be wrong with my archive manager set up.  I'll have
> to figure it out.  It handles zip fine but not tar.

Which OS? Which program?

On OS X, "tar xf" from the command line works for me.

On Windows, did you try 7-zip?

Regards,
Curtis


On Mon, Aug 4, 2014 at 4:34 PM, Brian Northan <[hidden email]> wrote:
Regarding the download problem.  The download is 141 MB.  So something must be wrong with my archive manager set up.  I'll have to figure it out.  It handles zip fine but not tar.


On Mon, Aug 4, 2014 at 5:14 PM, Brian Northan <[hidden email]> wrote:
Hi Curtis

Thanks, it worked perfectly - btw I doubled posted on the fiji list as I figured this question might be of interest to any fiji users trying out the new scripting.

Brian


On Mon, Aug 4, 2014 at 5:06 PM, Curtis Rueden <[hidden email]> wrote:
Hi Brian,

Thanks for the reports:

> 1.  The last couple of days when I try to extract the Fiji Linux 64
> continuous release tar file I get an error "truncated gzip input".  I can
> work around this by downloading the "all platforms" package instead. 

Hmm, I did not see this problem when I tried just now. Perhaps the download itself is not completing successfully? It should be ~141MB. If it keeps happening, we could add an MD5 sum for verification if that would be helpful.

> 2.  It seems that the ops service is not getting injected into my jython
> scripts.  Scripts works fine (ie data and display are injuected) until I try
> to call an op.  Then I get "ops is not defined".   This only happens when
> using a Fiji release.  If I run imagej2 through a development environment
> using maven it works. 

Yeah, I noticed this same problem the other day, and fixed it on master:


Using scijava-common-2.28.0 or later will avoid the issue. Or you can work around it by writing:

    # @net.imagej.ops.OpService ops

Regards,
Curtis


On Mon, Aug 4, 2014 at 3:32 PM, Brian Northan <[hidden email]> wrote:
Hi List

A couple of things...

1.  The last couple of days when I try to extract the Fiji Linux 64 continuous release tar file I get an error "truncated gzip input".  I can work around this by downloading the "all platforms" package instead.

2.  It seems that the ops service is not getting injected into my jython scripts.  Scripts works fine (ie data and display are injuected) until I try to call an op.  Then I get "ops is not defined".   This only happens when using a Fiji release.  If I run imagej2 through a development environment using maven it works.

Thanks, an example script is below

Brian

# @DatasetService data
# @DisplayService display
# @OpService ops

# define a local directory to get the images from
directory="/home/bnorthan/Brian2014/Images/TempForEasyAccess/"

# use 2-channels of the lena image for test image
image1Name="lena_red.tif"
image2Name="lena_green.tif"

# open first image
image1=data.open(directory+image1Name)
display.createDisplay(image1.getName(), image1);   

# open second image
image2=data.open(directory+image2Name)
display.createDisplay(image2.getName(), image2);

# add the images
image3 = ops.add(image1,image2)
display.createDisplay(image3.getName(), image3)




_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel






_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: 'ops not defined' when running jython script

Brian Northan
Ubuntu 14.04 GNU tar 1.27.1.  On second thought I must be having gremlins while downloading.  I tried again and the download was 148.1 MB this time and it worked.


On Mon, Aug 4, 2014 at 5:36 PM, Curtis Rueden <[hidden email]> wrote:
Hi Brian,

> So something must be wrong with my archive manager set up.  I'll have
> to figure it out.  It handles zip fine but not tar.

Which OS? Which program?

On OS X, "tar xf" from the command line works for me.

On Windows, did you try 7-zip?

Regards,
Curtis


On Mon, Aug 4, 2014 at 4:34 PM, Brian Northan <[hidden email]> wrote:
Regarding the download problem.  The download is 141 MB.  So something must be wrong with my archive manager set up.  I'll have to figure it out.  It handles zip fine but not tar.


On Mon, Aug 4, 2014 at 5:14 PM, Brian Northan <[hidden email]> wrote:
Hi Curtis

Thanks, it worked perfectly - btw I doubled posted on the fiji list as I figured this question might be of interest to any fiji users trying out the new scripting.

Brian


On Mon, Aug 4, 2014 at 5:06 PM, Curtis Rueden <[hidden email]> wrote:
Hi Brian,

Thanks for the reports:

> 1.  The last couple of days when I try to extract the Fiji Linux 64
> continuous release tar file I get an error "truncated gzip input".  I can
> work around this by downloading the "all platforms" package instead. 

Hmm, I did not see this problem when I tried just now. Perhaps the download itself is not completing successfully? It should be ~141MB. If it keeps happening, we could add an MD5 sum for verification if that would be helpful.

> 2.  It seems that the ops service is not getting injected into my jython
> scripts.  Scripts works fine (ie data and display are injuected) until I try
> to call an op.  Then I get "ops is not defined".   This only happens when
> using a Fiji release.  If I run imagej2 through a development environment
> using maven it works. 

Yeah, I noticed this same problem the other day, and fixed it on master:


Using scijava-common-2.28.0 or later will avoid the issue. Or you can work around it by writing:

    # @net.imagej.ops.OpService ops

Regards,
Curtis


On Mon, Aug 4, 2014 at 3:32 PM, Brian Northan <[hidden email]> wrote:
Hi List

A couple of things...

1.  The last couple of days when I try to extract the Fiji Linux 64 continuous release tar file I get an error "truncated gzip input".  I can work around this by downloading the "all platforms" package instead.

2.  It seems that the ops service is not getting injected into my jython scripts.  Scripts works fine (ie data and display are injuected) until I try to call an op.  Then I get "ops is not defined".   This only happens when using a Fiji release.  If I run imagej2 through a development environment using maven it works.

Thanks, an example script is below

Brian

# @DatasetService data
# @DisplayService display
# @OpService ops

# define a local directory to get the images from
directory="/home/bnorthan/Brian2014/Images/TempForEasyAccess/"

# use 2-channels of the lena image for test image
image1Name="lena_red.tif"
image2Name="lena_green.tif"

# open first image
image1=data.open(directory+image1Name)
display.createDisplay(image1.getName(), image1);   

# open second image
image2=data.open(directory+image2Name)
display.createDisplay(image2.getName(), image2);

# add the images
image3 = ops.add(image1,image2)
display.createDisplay(image3.getName(), image3)




_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel







_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: 'ops not defined' when running jython script

dscho
Administrator
Hi Brian,

On Mon, 4 Aug 2014, Brian Northan wrote:

> Ubuntu 14.04 GNU tar 1.27.1.  On second thought I must be having gremlins
> while downloading.  I tried again and the download was 148.1 MB this time
> and it worked.

It could be that you downloaded it with one of those web browsers that
like to unpack gzipped data without removing the .gz suffix. Happened to
me.

Ciao,
Johannes

_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel