![]() "_" is common seprator for user name parts, so we need to assume more than one. NumOfSeparators = ItemsInList(FileName, "_") //number of string parts separated by "_" ![]() String TextFileName //place for the file name ![]() now figure out the name of the text file. Basically, images are here.Ībort "Path to 2D data does not exist" //abort First check if path to data exists, this is symbolic path Nika uses to name we need to return 5th element - thickness - (Igor is 0 based, so item 4) date time\tFileName\tMon1\tMon2\tThickness\tTransmission image in name: ImageName_XX.tif -> the text file name: ImageName.txt this function reads from text file assuming name template: type ReadThickness (no " or ', just the letters) with no parameters or () on tab "Par" check "Use fnct?" for Sa Thickness in the field Then in Nika : check "use sample Thickness (t)" checkbox and ipf files placed in Igor Procedures folder are loaded always when Igor starts. Documents/Wavemetrics/Igor Pro 7 User Procedures/Igor Procedures ![]() To use this place this code in a text file with extension. this function can be easily modified to return different values from the table This function depends on rigid name structure and known and fixed text file content. if you need help with your function, make sure you send me your current version To read a specific value from this code I wrote following function: In Igor debugger (and for Igor code) this line looks like this: In text editor or Igor history area this line looks like this: Inside the text file are few (9 in my case) lines of header with various common information (sample name, instrument conditions, etc.) and then lines with tab separated values for each image - such as date time, file name, Monitor1, Monitor2, thickness, transmission etc. Then we have associated text file, in this case named Image_file.txt (that is “ArbitraryString.txt”). Names are basically “ArbitraryString_XY.tif”. Each group has some number of images with names similar to Image_file_01.tif, Image_file_02.tif, etc. In this case we have a folder contains multiple “groups” of files belonging together. Below is an example of the resulting functions which you can modify with relatively little Igor expertise… Recently I was asked to help users with the second setup - one text file for few images - to write look up functions. This can be done relatively efficiently and one can (and should) write Igor function which loads the text file so wave names and location of the waves are fixed and code then can rely on their presence. This text file can now contain some header info and possibly, like in the case example below, smaller number of lines where each line relates to one of the images.įor the one large file the best method is to manually load the text content in Igor first in separate folder in waves and then look up these values from there. Many (smaller) text files, where each image (or few images) have one associated text file - usually with name related to the images name by simple recipy.This text file contains one line of information for each image in that folder, usually with file name of the image within the line itself. One (potentially very large) text file in a folder with lots of images (or in the parent folder of the folder with these images).I used both of these methods long time ago and still see many users with data stored this way. There are two basic methods of how metadata are stored - at least from my experience. But, this is widely used, common method, and therefore needs to be supported. This makes it for very poor target for programming, as the code which handles such metadata is always changing. Also, usually this method is created ad hoc and also ad hoc modified. The main disadvantage of this method is a chance that metadata and image get separated and generally it is cumbersome. This is an ugly (obsolete) method which has been used for long time with images (like tiff files) which do not easily enable storing metadata with the image itself.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |