MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Problem with Map & For Loop !

  • To: mathgroup at
  • Subject: [mg128157] Problem with Map & For Loop !
  • From: charitonick at
  • Date: Wed, 19 Sep 2012 04:59:19 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:

Dear Mathematica Users & Developers,

First of all thank you a priori for your help.

I have a "Strange" problem with a For loop and Image Manipulation, into which I would very much appreciate your help.

SetDirectory["C:\\Something\\images"] ; (*is the directory of my images, about 1000 images in there*)

names = FileNames["*.tif"];
images = Map[Import, names];

(*The problem now is that I want to take from all the picture, the same pixel value, and I want to do that for several pixels. More specifically for Y pixels from 0 to 302. So: *)

PixX = {5, 5};
While [b < 302, PixY = Table[{10, b}, {b, 302}]; b++;] (*In order to fill a table with the Y pixels that I want to take their values*)

Next I thought a FOR loop: 

For[i < 302, i++, Map[ImageTake[#, PixY[[i]], PixX] &, images]]

My problem is that, Mathematica gives *no output* to that command, and I really don't know how, and if I can, assign a different name to the output of this command each time, in order to use afterwards ImageData[name] and take the pixel values each time. 

Am I thinking something wrong?
Sincerely yours,

  • Prev by Date: Re: How to solve the integrate problem
  • Next by Date: Re: Epilog/Prolog and Show Question
  • Previous by thread: Weighting in simultaneous NonlinearModelFits
  • Next by thread: Copying Text From CDF Output Cells