public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: David Pirotte <david@altosw.be>
To: kawa <kawa@sourceware.org>
Subject: ImagJ/Fiji 'binding' wrong argument type - help welcome
Date: Sun, 21 Jan 2018 03:37:00 -0000	[thread overview]
Message-ID: <20180121013700.00afafbe@capac> (raw)

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

Hi again,

While expecting some help wrt my previous message, I tried another 'binding' using
another class of the same plugin [1]

This time, though I will later want to avoid it, I wrote 'binding' so it calls the
imagej/fiji 'ecosystem', which means calling the procedure "run", defined in ij.IJ
(which I 'bind' in my ij-core.scm module). This works fine, but then my problem is
to get access to the result, see:

1-

  (import (ij-core))

  (export ij-geometry-to-distance-map)

  (define (ij-geometry-to-distance-map iplus1 #!optional (threshold 128))
    (ij-run iplus1
            "Geometry to Distance Map"
            (string-append "threshold="
                           (number->string threshold))))

then

  export CLASSPATH=.:./jars/ij.jar:./jars/local-thickness.jar
  kawa -C ij-local-thickness.scm

and using it

  david@capac:~/lpdi/projects/kawa 16 $ kawa -Dplugins.dir=/usr/lpdi/projects/kawa/jars
  #|kawa:1|# (import (ij-core)
          (ij-local-thickness))
  #|.....2|# #|kawa:3|# (define iplus1 (ij-open "images/camada-mapa.png"))
  #|kawa:4|# (ij-geometry-to-distance-map iplus1)
  #!null
  #|kawa:5|# 

perfect, but I don't get the resulted computed image, because "run" doesn't return
anything in their ecosystem with their string based API


2-

I add a binding to the getResultImage of that class

  (define-alias get-result-image-edt
    sc.fiji.localThickness.EDT_S1D:getResultImage)

I use it, and I pass a wrong first argument on purpose, to see
what the system expects:

  (define (ij-geometry-to-distance-map iplus1 #!optional (threshold 128))
    (ij-run iplus1
            "Geometry to Distance Map"
            (string-append "threshold="
                           (number->string threshold)))
    (get-result-image-edt iplus1))

-|
...
#|kawa:4|# (ij-geometry-to-distance-map iplus1)
Argument #1 (null) to 'sc.fiji.localThickness.EDT_S1D.getResultImage()' has wrong type (expected: sc.fiji.localThickness.EDT_S1D)


So it seems that these methods (including the one in my previous mail), expect as
their first argument the instance of the class upon which to run the code ...

But how do I get access to the instance created by imagej or
these plugin classes?


Thanks,
David

[1] https://github.com/fiji/LocalThickness/blob/master/src/main/java/sc/fiji/localThickness/EDT_S1D.java

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

                 reply	other threads:[~2018-01-21  3:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180121013700.00afafbe@capac \
    --to=david@altosw.be \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).