안녕,
이미지를 데이터 테이블로 변환하여 스크립트와 함께 JMP를 사용하여 6개의 이미지를 분석하고 있습니다.
모든 이미지 값을 1개의 데이터 테이블에 연결했습니다.
문제는 이전 이미지 데이터 테이블을 Close( Data Table( Tables[i] ), No Save )로 닫을 수 있다는 것입니다.
하지만 6개의 이미지를 닫을 수 없습니다.
Close(img) 또는 Close("image")와 같은 것을 시도했지만 닫히지 않습니다.
스크립트에서 이미지를 닫는 방법을 알고 있습니까?

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);
이와 같은 것이 이미지 창을 닫기 위해 원하는 것을 얻을 수 있습니다.
i = 1;
While( Window( i ) << get window title != "",
If( Left( Window( 1 ) << get window title, 5 ) == image,
Window( i ) << close window
);
i++;
);
확장 중 @txnelson 의 솔루션:
찾고 있는 메시지는 창 참조를 가리키는 << 창 닫기입니다. 코드에서 이러한 참조를 w 및 w2에 할당하므로 해당 개체에 << Close Window를 보냅니다.
Names Default To Here( 1 );
// Read the image1:RED into JMP
img = New Image( "$Capillary Photo 2\RED.jpg" );
w = New Window( "image", img );
Wait( 5 );
w << close window;
또한 픽셀을 가져오기 위해 창에 이미지를 표시할 필요가 없습니다.
Names Default To Here( 1 );
image = New Image( "$SAMPLE_IMAGES/windmap.png" );
{r, g, b} = image << getPixels("rgb");
show(r);
유사하게, 중간 데이터 테이블을 표시하지 않도록 할 수 있습니다. 사적인 :
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")),
Private // no display window is created; when dt1 is assigned something else the data table will be destroyed
);