[ImageJ-devel] 'ops not defined' when running jython script

Brian Northan bnorthan at gmail.com
Mon Aug 4 16:14:11 CDT 2014


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 <ctrueden at wisc.edu> 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:
>
>
> https://github.com/scijava/scijava-common/commit/f88984cb587c314c53e06fdce606d4cecf3a4813
>
> 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 <bnorthan at gmail.com> 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
>> ImageJ-devel at imagej.net
>> http://imagej.net/mailman/listinfo/imagej-devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20140804/2ccffe43/attachment.html>


More information about the ImageJ-devel mailing list