Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11814

Problem with Map & For Loop !

From charitonick@gmail.com
Newsgroups comp.soft-sys.math.mathematica
Subject Problem with Map & For Loop !
Date 2012-09-19 08:57 +0000
Message-ID <k3c1em$f00$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


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


Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Problem with Map & For Loop ! charitonick@gmail.com - 2012-09-19 08:57 +0000

csiph-web