• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scanning pixels of .tiff image using imageJ library

 
me erum
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic