The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Confocal Image Stacks
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mjmgormley

USA
1 Posts

Posted - 06/08/2015 :  3:34:40 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I'm working with confocal laser scanning microscope image stacks.

For example, take a region whose physical dimensions are X=200 microns, Y=200 microns, Z= 40 microns.

It is scanned across XY at 1024x1024 pixels, 20 times through the Z plane; each cell containing the intensity (0-255 byte) measured at that point in space.

The result is 20 ASCII matrix files, 1024x1024 (thus X=0.2 um/px, Y=0.2 um/px, Z=2 um/matrix).

I seek the means to build an XYZI table, corresponding to the Cartesian XYZ coordinate of each voxel along with the Intensity (0-255 byte) measured at that point.

I can create a matrix window containing a matrix sheet for each file. I can individually convert each sheet to XYZ (where Z corresponds to "I" above). Now I'm stuck. I need Origin to, for lack of better phrasing, combine the entire matrix object into a single table given the unit conversion between X,Y,Z. Possible?

Thank you so much!

P.S. In case you're wondering, my goal is to apply this to multiple color scans and use Principal Component Analysis to discover patterns.

Edited by - mjmgormley on 06/08/2015 3:39:32 PM

SeanMao

China
288 Posts

Posted - 06/09/2015 :  02:49:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can run following LabTalk script to create a XYZI table suppose matrix books are naming as "Z0um", "Z2um", "Z4um",... etc:

doc -e M // Loop through all matrix books
{
	matrix -ps X 0 200; // Set X range from 0 to 200
	matrix -ps Y 0 200; // Set Y range from 0 to 200
	@glob=1;
	string strMat$ = page.longname$;
	strMat$ = strMat.Between("Z","um")$; // Get Z Values from MatrixBook Long Name
	int ZHeight = %(strMat$);
	m2w method:=xyz; // Convert Matrix to XYZ
	wks.addcol(ZHeight); // Add Z column
	csetvalue col:=col(ZHeight) formula:="ZHeight"; // Set Value from Numeric Extracted from Matrix Long Name
}

@glob = 1;
string strPWKB$ = page.name$; // Let Current Workbook as Parent Workbook
string strPWKS$ = wks.name$; // Remember Current Worksheet for Appending Other Sheets

doc -e W // Loop through all Workbooks
{
	string strTempWKB$ = page.name$; // Book Short Name of Current Workbook
	if (strTempWKB$ != strPWKB$) // If not Parent Workbook, Start Appending
	{
		wAppend irng:=([%(strPWKB$)]1!, [%(strTempWKB$)]1!) method:=row ow:=[%(strPWKB$)]1!; // Appending
		win -c %(strTempWKB$); // Delete Appended Worksheets
	}
	else
		continue;
}
dataset sps = {4,1};
dataset sodr = {1,1};
wsort nestcols:=sps order:=sodr; // Sort Appened Worksheets by Z (Height)
colmove rng:=col(4) operation:=left; // Move Z column to be 3rd Column
wks.col1.lname$="X";
wks.col2.lname$="Y";
wks.col3.lname$="Z";
wks.col4.lname$="Intensity";
page.longname$= "XYZI Table";
page.title=1; // Naming


Regards!

Sean

OriginLab Tech. Service

Edited by - SeanMao on 06/09/2015 02:51:54 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000