Philips Independent User Group web page. The information and opinions on this site neither belong to or are endorsed by Philips. Individuals have submitted these pages, they may be used at the surfer's own risk. Any programs copied down should be tested thoroughly by the end user. No liability rests with the author, Philips or the hosts of the site.

Pick and Select

These are the two main ways for a macro to get some files

Pick is for operators to manually pick files. Select is for the programmer to automatically select files based on a wide range of criteria, such as "acquisition ID", "View ID", path, filename etc. etc. Its really useful to make macros faster and more immune to operator error, but NOTE WELL, wrong file selection is one of the most serious causes of error, so if you use select check your work carefully, test it and be particularly vigilant about the possibility of duplicate ambiguous selection criteria.


Pick in Practice

Pick is the easiest of commands right? You just code .pick and the operator does the rest. What's more if they pick the wrong file, its not your fault: lovely! But lets be a bit more professional about this, what if the operator does not pick enough files or too many, surely you donít want your macro to crash? Here's a skeleton of a macro which does something (anything you put in it) with each of the files the operator picks, but more importantly stops trying to do it when there aren't any more files left to do it on and so avoids the embarrassing yellow windows. MACRO. Here it is fleshed out with a show command which shows up to 4 files in E cell format. MACRO. The macros are annotated to explain how the trapping works. Unfortunately they donít trap the opposite situation, where the operator selected more than 4 files. Can you solve that?

Here's a complete macro for various formats of display using the principles above. The buttons look like this:




Here's a complete screen grab. (400k)





We're all proud of the number of myocardials we churn through these days. All that picking would get pretty tiresome. The solution is select. The idea being that you acquire most scans in routine acquisition macros so their images all have stable and predictable header information (Acquisition ID, Image ID, View ID etc), therefore you can automatically select the files by these criteria, and save all that picking. This is one of those situations where it is human to err but to really screw up it takes a computer. Because if you get the use of select right, you eliminate a source of random human error (the operator picking the wrong file) but if you get it wrong you could be responsible for giving incorrectly labeled output on every patient the macro is used on, for a very long time. i.e. until someone notices it. Imagine how embarrassing that would be. So take a deep breath and read on.

There is one essential safety feature of the select function, when it completes, an environment variable ($SELECT_FILE_COUNT) is set with the number of files which select found. So after running select, check this variable, if it is any value except one, you can divert the operation of the program. Either leave a message asking the operator to delete or rename files so that there is just one file that fits the select criteria and then exit. Or divert the operator into a manual selecting routine. One useful tip on the latter is that if the operator has been given sufficient instructions in a prompt, and then you run the index function, the files available to Pixie (and your select call) will be limited to the ones which the operator selects form the index. This allows the operator to narrow down the files for selecting from without having to manually pick a lot of files in exact order. The cardiac display macro in the 2004 UGM section of this site uses that methodology, but the macro here uses the former approach to display DMSA scans.