Hi,
I'm analyzing 6 images using JMP with script by converting the images into data table.
I've concatenated all the images values into 1 data table.
The issue is, I can close the previous image data table with Close( Data Table( Tables[i] ), No Save );
But I can't close the 6 images.
I tried something like Close(img) or Close("image") but it won't close.
Any idea how to close the images in script?
NamesDefaultToHere(1);
// Read the image1:RED into JMP
img = NewImage("$Capillary Photo 2\RED.jpg");
w = newWindow("image", img);
// Get the pixel values as 3 distinct matrices (red, green and blue)
// RGB colors are in normalized color space (0.0-1.0)
{r, g, b} = img << getPixels("rgb");
// Convert rgb to gray-scale (intensity) matrix
i = 0.3*r + 0.59*g + 0.11*b;
// Get the pixel values as JSL colors then convert to hue, lightness and saturation
// HLS colors are in normalized color space (0.0-1.0)
jslColors = img << getPixels();
{h, l, s} = ColorToHLS(jslColors);
// Get the dimensions of the image/matrices
numRows = nrow(r);
numCols = ncol(r);
// Create a data table
dt1 = New Table("Image Data Red",
newColumn("X", set values(repeat(1::numCols, numRows))),
newColumn("Y", set values(shape(repeat(1::numRows,numCols)`,numCols,numRows))),
newColumn("r", set values(r)),
newColumn("g", set values(g)),
newColumn("b", set values(b)),
newColumn("i", set values(i)),
newColumn("h", set values(h)),
newColumn("l", set values(l)),
newColumn("s", set values(s)),
newColumn("CapillaryType", character, set each value("RED"))
);
img2 = NewImage("$\Capillary Photo 2\BLUE.jpg");
w2 = newWindow("image", img2);
//Some of other parts of script omitted (repetitive)
//Concatenation All Tables into 1
// Create your Tables list
Tables = {};
For( i = 1, i <= N Table(), i++,
Insert Into( Tables, Data Table( i ) << get name );
);
new Table("Image Data AllColour");
// Run the concatinations table
For( i = 1, i <= N Items( Tables ), i++,
Data Table( "Image Data AllColour" ) << Concatenate(
Data Table( Tables[i] ),
append to first table(1)
);
Close( Data Table( Tables[i] ), No Save );
);
Wait(0);
//the image objects still exist
//show(img);
//show(img2,3,4,5,6);
img = empty();
img2 = empty();
img3 = empty();
img4 = empty();
img5 = empty();
img6 = empty();
show(img, img2, img3, img4, img5, img6); //see LOG: img = Empty(); img2 = Empty();
delete symbols({img, img2, img3, img4, img5, img6});
show symbols();
Close(img);