Column with image ID to import images from folder.<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I have a data file with 12 columns.
First column is panelist ID. Second column is the numeric ID of a picture the panelist took of the product they were using. The other 10 columns are properties for the product that the panelist used.
I have a folder with all the pictures that the consumers took of the products with the name of each picture matching the second column values.
I would like JMP to be able to import the pictures into the cells so that I can use the pictures in graphs and visual screening of the table.
Is this possible in any way? Could a script be written for this?
Thanks
Re: Column with image ID to import images from folder.Yes, something similar was proposed in the above thread (Import Image from URL into Expression Column) but without the loop, just set as a formula in the column.
dt = New Table("test", Add Rows(1),
New Column("ImageTitle", Character, Nominal, Set Values({"Capture"})),
New Column("Image", Expression, Formula(New Image(dt:Location || :ImageTitle || ".png")))
);
dt << Set Table Variable("Location", "C:\Photos\");
Image with path C:\Photos\Capture.png will be displayed in column 2 (:Image)
Thanks for the help!
Re: Column with image ID to import images from folder.You might get somewhere if you used a script like this (open your 12 column data table first)...
dt = Current Data Table();
dt << New Column("Image", Expression);
imagePath = "C:\Users\...\My Documents\Project\Photos\"; /* set to the correct folder that contains the images */
For Each Row( :Image = New Image(imagePath || :Column 2 || ".png") ); /* replace Column 2 in the middle of the statement with the correct name of the second column */
Re: Column with image ID to import images from folder.Thanks! I found some start of a solution here ( Import Image from URL into Expression Column)
This seems to look like what I need:
New Table("test", Add Rows(1), New Column("Image", Expression));
:Image[1] = New Image("C:\Photos\Capture.png"
);
Re: Column with image ID to import images from folder.Pablo,
One more thing. Go to the General Discussions page and type expressions in the search box. I found a few things there that might be of interest to you.
Best,
Bill
Re: Column with image ID to import images from folder.Hi Pablo,
I have forwarded your feature request to JMP Tech Support.
Thanks,
Bill
Re: Column with image ID to import images from folder.Hi Bill,
Indeed, adding the images one by one following the procedure you describe is the only solution I found. It just gets boring after picture 200 ☺ plus the file becomes big.
I just thought it would be a nice feature if the expression role “picture” would have an option to specify a path. This way, the column would contain picture names only but those could be turned into pictures with a couple clicks, do the analysis/graph with the pictures and go back to numbers before saving to minimize file size.
Just an idea, maybe for the future ☺
Regards,
Pablo Moreno Peláez
R&D – Home Care M&S
I read my e-mail twice a day. If you have an urgent request, please call or IM me.
Re: Column with image ID to import images from folder.Hello,
The pictures themselves can be imported easily, but on a one-by-one drop and drag basis. You have to create a new column for the images and make the data type Expression in Column Info. You also need to make sure that column properties are set to Expression Role and the expression role is Picture.
Not sure on using a script to import the images, but would be happy to discuss over a phone call and/or WebEx.
Best,
Bill Worley
JMP SE
bill.worley@jmp.com