Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

Is there a way to deal with line numbers in ImageJ and/or java?

Thread view: 
academic - 14 Feb 2006 14:27 GMT
I'm new to java and don't know if this is a java question or an ImageJ
question.
BTW, Is there an ImagJ NG?

I try to compile some examples in ImageJ and it appears to be complaining
about the line numbers.

Is there a way to deal with line numbers in ImageJ and/or java?

Thanks
Chris Smith - 14 Feb 2006 15:26 GMT
> I'm new to java and don't know if this is a java question or an ImageJ
> question.
> BTW, Is there an ImagJ NG?

This is as good a group as any.

> I try to compile some examples in ImageJ and it appears to be complaining
> about the line numbers.
>
> Is there a way to deal with line numbers in ImageJ and/or java?

In a Java source file, or in an ImageJ macro?  Java doesn't have line
numbers, and I don't see any in ImageJ macros from the documentation on
their web site, either.

Perhaps you should post a simple example.

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

academic - 14 Feb 2006 16:43 GMT
I down loaded the below example and want to compile and run it to get a feel
for plugin coding.
It's named Inverter_.java

Thanks for being helpful

1 import ij.*;
2 import ij.plugin.filter.PlugInFilter; 3 import ij.process.*;
4 import java.awt.*;
5
6 /**
7 This example plugin filter inverts an Image that can
8 be in any of the four data types supported by ImageJ:
9 unsigned byte, unsigned short, float and RGB.
10 */
11
12 public class Inverter_ implements Plug.lnFilter {
13
14 public int setup(String arg, ImagePlus imp) {
15 if (arg.equals ("about"))
16 {showAbout(); return DONE;}
...snip

>> I'm new to java and don't know if this is a java question or an ImageJ
>> question.
[quoted text clipped - 12 lines]
>
> Perhaps you should post a simple example.
Thomas Hawtin - 14 Feb 2006 17:18 GMT
> I down loaded the below example and want to compile and run it to get a feel
> for plugin coding.
> It's named Inverter_.java

> 12 public class Inverter_ implements Plug.lnFilter {

Google finds the code apparently as it should appear:

http://www.imaging.robarts.ca/~sdeoni/plugins/Demos/Inverter_.java

Presumably the line numbers were used to refer to particular lines from
an accompanying article. They are not part of the program.

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

Thomas Weidenfeller - 14 Feb 2006 15:30 GMT
> I'm new to java and don't know if this is a java question or an ImageJ
> question.
[quoted text clipped - 4 lines]
>
> Is there a way to deal with line numbers in ImageJ and/or java?

A couple of things:

- Your question is so vague, that it is close to impossible to determine
what your problem is. We have to guess. Please consider
http://www.catb.org/~esr/faqs/smart-questions.html

- Beginner's questions are typically handled in comp.lang.java.help. But
this also doesn't excuse you from doing your own homework.

- A guess: If you try to compile Java source code with leading line
numbers, then there is something very wrong. Unlike languages like
classic BASIC, line numbers are not part of Java source code. You are
either trying to compile something which is not Java at all, or you
somehow managed to add some leading line numbers to some Java code.

- Another guess: The compiler complains about some error at a specific
line in your code. In this case examine your source code. Examine the
location the compiler pointed out! The compiler is in no way complaining
about the line number as such, but about an error in (or near) that
line, and the compiler is so helpful to tell you where it thinks things
go wrong. If you have such an error, people here need (a) the original,
complete, unaltered error message. Copyed'n'pasted directly into your
posting, not retyping it, and (b) the complete small source code. If
your code is not small, you need to write a small demo example which
still demonstrates the problem. Otherwise, we can only guess. We need
something to work with, and something which is so small, that we don't
have to waste time to peal out the real problem from a pile of code.

/Thomas
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

academic - 14 Feb 2006 16:51 GMT
>> I'm new to java and don't know if this is a java question or an ImageJ
>> question.
[quoted text clipped - 13 lines]
> - Beginner's questions are typically handled in comp.lang.java.help. But
> this also doesn't excuse you from doing your own homework.

What are you assuming here?

> - A guess: If you try to compile Java source code with leading line
> numbers, then there is something very wrong. Unlike languages like classic
> BASIC, line numbers are not part of Java source code. You are either
> trying to compile something which is not Java at all, or you somehow
> managed to add some leading line numbers to some Java code.

I down loaded an example. See my post to Chris
I'm sure I'm doing something wrong - that the reason for my question.

> - Another guess: The compiler complains about some error at a specific
> line in your code. In this case examine your source code. Examine the
> location the compiler pointed out! The compiler is in no way complaining
> about the line number as such, but about an error in (or near) that

I'm not sure I understand - the downloaded code does have line numbers so
if the compiler can't handle them why wouldn't it complain about them?

Thanks for replying

> line, and the compiler is so helpful to tell you where it thinks things go
> wrong. If you have such an error, people here need (a) the original,
[quoted text clipped - 6 lines]
>
> /Thomas
Oliver Wong - 14 Feb 2006 18:06 GMT
>>> I'm new to java and don't know if this is a java question or an ImageJ
>>> question.
>>> BTW, Is there an ImagJ NG?

   Not that I know of.

>>> I try to compile some examples in ImageJ and it appears to be
>>> complaining about the line numbers.
[quoted text clipped - 11 lines]
>
> What are you assuming here?

   Thomas is probably assuming that this is a beginner question, since you
opened your message with "I'm new to Java", and so basically he was saying
comp.lang.java.help is "more geared" to beginner questions than
comp.lang.java.programmer.

>> - A guess: If you try to compile Java source code with leading line
>> numbers, then there is something very wrong. Unlike languages like
[quoted text clipped - 12 lines]
> I'm not sure I understand - the downloaded code does have line numbers so
> if the compiler can't handle them why wouldn't it complain about them?

   Everything starting from "- Another guess:" doesn't apply to your
situation. It's just that your original question as phrased as to be
ambiguous as to what the actual problem was. Thomas was making some educated
guesses as to what problems you were having, thinking perhaps that your
compiler gave you a message with the key words "Error" and "line number",
and you had mistakenly assumed that it was complaining about the line number
itself, when actually what the compiler is saying that some (unspecified)
error is located on that specific line number. It turns out that this second
guess is wrong (based on your post to Chris).

   As to "if the compiler can't handle them why wouldn't it complain about
them?", probably because it never occurred to the person who wrote compiler
to actually check and complain about line numbers. It's kind of like
sticking a celery in the CD-drive of your computer will probably cause it to
break, but the error message you see won't be "Error: You inserted a celery
into the CD drive". The computer can't handle celeries, but that doesn't
mean there will be an error message specifically tailored for that
situation.

   - Oliver
academic - 14 Feb 2006 18:57 GMT
thanks for your input.
Chris answered my original question and knowing that java does not use line
numbers I was able to move on and will probably need different help soon.

thanks again

>>>> I'm new to java and don't know if this is a java question or an ImageJ
>>>> question.
[quoted text clipped - 60 lines]
>
>    - Oliver
Roedy Green - 14 Feb 2006 18:37 GMT
>I'm new to java and don't know if this is a java question or an ImageJ
>question.
>BTW, Is there an ImagJ NG?

JDisplay shows listings with optional line numbers on my website. They
help in discussions of code and relating error messages to particular
lines of code.  You must strip them off before compiling.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

academic - 14 Feb 2006 18:59 GMT
Thanks, that's all I needed to know. I'm compiling and debugging now.

>>I'm new to java and don't know if this is a java question or an ImageJ
>>question.
[quoted text clipped - 3 lines]
> help in discussions of code and relating error messages to particular
> lines of code.  You must strip them off before compiling.
Josh Falter - 15 Feb 2006 13:36 GMT
There is an active ImageJ newsgroup that is very active.  You can sign
up at http://rsb.info.nih.gov/ij/list.html
academic - 15 Feb 2006 18:21 GMT
Thanks, I'll check that out

> There is an active ImageJ newsgroup that is very active.  You can sign
> up at http://rsb.info.nih.gov/ij/list.html


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.