Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Problem with Map & For Loop !

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128157] Problem with Map & For Loop !
  • From: charitonick at gmail.com
  • Date: Wed, 19 Sep 2012 04:59:19 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

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};
b=0;
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,
Nikos





  • 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