File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes scanning pixels of .tiff image using imageJ library Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "scanning pixels of .tiff image using imageJ library" Watch "scanning pixels of .tiff image using imageJ library" New topic

scanning pixels of .tiff image using imageJ library

me erum

Joined: Feb 05, 2012
Posts: 2
im using the imageJ library to read a .tiff image file. But when im trying to read the pixels of image1 in variable c, i get an error saying "incompatible types: required int, found int[]. im quiet new to java, so can somebody tell me how to get around this problem. The code is otherwise working fine with other image formats.

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15046

The error means that the method you are calling returns an int[] (array of int), but you are trying to assign that to an int (because c is an int). That won't fit; you cannot put an array of integers in a single integer. Find the documentation of the ImagePlus class and read what the getPixel() method returns exactly.

(Please UseCodeTags and indent your code properly).

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Darryl Burke

Joined: May 03, 2008
Posts: 5093

Please BeForthrightWhenCrossPostingToOtherSites

luck, db
There are no new questions, but there may be new answers.
I agree. Here's the link:
subject: scanning pixels of .tiff image using imageJ library
It's not a secret anymore!