<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to close multiple images loaded after obtain the data table using JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-close-multiple-images-loaded-after-obtain-the-data-table/m-p/561538#M77461</link>
    <description>&lt;P&gt;Something like this should get you what you want, to close the image windows.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;i = 1;
While( Window( i ) &amp;lt;&amp;lt; get window title != "",
	If( Left( Window( 1 ) &amp;lt;&amp;lt; get window title, 5 ) == image,
		Window( i ) &amp;lt;&amp;lt; close window
	);
	i++;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 28 Oct 2022 03:23:53 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2022-10-28T03:23:53Z</dc:date>
    <item>
      <title>How to close multiple images loaded after obtain the data table using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-multiple-images-loaded-after-obtain-the-data-table/m-p/561517#M77460</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm analyzing 6 images using JMP with script by converting the images into data table.&lt;/P&gt;&lt;P&gt;I've concatenated all the images values into 1 data table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is, I can close the previous image data table with Close( Data Table( Tables[i] ), No Save );&lt;/P&gt;&lt;P&gt;But I can't close the 6 images.&lt;/P&gt;&lt;P&gt;I tried something like Close(img) or Close("image") but it won't close.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea how to close the images in script?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WebDesignesCrow_0-1666924345277.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/46666iA2E08748ACB461EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WebDesignesCrow_0-1666924345277.png" alt="WebDesignesCrow_0-1666924345277.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 &amp;lt;&amp;lt; 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 &amp;lt;&amp;lt; 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 &amp;lt;= N Table(), i++,
	Insert Into( Tables, Data Table( i ) &amp;lt;&amp;lt; get name );
);
new Table("Image Data AllColour");
// Run the concatinations table
For( i = 1, i &amp;lt;= N Items( Tables ), i++,
	 Data Table( "Image Data AllColour" ) &amp;lt;&amp;lt; 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);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:01:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-multiple-images-loaded-after-obtain-the-data-table/m-p/561517#M77460</guid>
      <dc:creator>WebDesignesCrow</dc:creator>
      <dc:date>2023-06-09T16:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple images loaded after obtain the data table using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-multiple-images-loaded-after-obtain-the-data-table/m-p/561538#M77461</link>
      <description>&lt;P&gt;Something like this should get you what you want, to close the image windows.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;i = 1;
While( Window( i ) &amp;lt;&amp;lt; get window title != "",
	If( Left( Window( 1 ) &amp;lt;&amp;lt; get window title, 5 ) == image,
		Window( i ) &amp;lt;&amp;lt; close window
	);
	i++;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Oct 2022 03:23:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-multiple-images-loaded-after-obtain-the-data-table/m-p/561538#M77461</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-10-28T03:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple images loaded after obtain the data table using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-multiple-images-loaded-after-obtain-the-data-table/m-p/561541#M77462</link>
      <description>&lt;P&gt;Expanding on&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;'s solution:&lt;BR /&gt;&lt;BR /&gt;The message you're looking for is &amp;nbsp;&amp;lt;&amp;lt; Close Window pointed at your window reference. In your code you're assign these references to w and w2, so you would send &amp;lt;&amp;lt; Close Window to those objects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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 &amp;lt;&amp;lt; close window;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Additionally, it's worth noting that you don't need to display the images in a window to get the pixels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
image = New Image( "$SAMPLE_IMAGES/windmap.png" );

{r, g, b} = image &amp;lt;&amp;lt; getPixels("rgb");

show(r);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similarly, you could avoid displaying the intermediate data tables by making them &lt;A href="https://www.jmp.com/support/help/en/17.0/#page/jmp/hide-a-data-table.shtml" target="_self"&gt;Private&lt;/A&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;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
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2022 03:50:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-multiple-images-loaded-after-obtain-the-data-table/m-p/561541#M77462</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2022-10-28T03:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to close multiple images loaded after obtain the data table using JSL</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-multiple-images-loaded-after-obtain-the-data-table/m-p/562271#M77535</link>
      <description>&lt;P&gt;Thanks a lot &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6878"&gt;@Jeff_Perkinson&lt;/a&gt;&amp;nbsp; &amp;amp;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;. Got it !&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 01:20:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-multiple-images-loaded-after-obtain-the-data-table/m-p/562271#M77535</guid>
      <dc:creator>WebDesignesCrow</dc:creator>
      <dc:date>2022-10-31T01:20:52Z</dc:date>
    </item>
  </channel>
</rss>

