Presentation is loading. Please wait.

Presentation is loading. Please wait.

Really simple Workbench Macro Mike Avison (apologies to advanced users)

Similar presentations


Presentation on theme: "Really simple Workbench Macro Mike Avison (apologies to advanced users)"— Presentation transcript:

1

2 Really simple Workbench Macro Mike Avison (apologies to advanced users)

3 About Workbench Macros How do they differ from Pixie macros? They output image files on disk (The only image you can store from Pixie is a Lightbox) There are no control functions (if, then, goto etc) There are no variables (as far as I am aware)

4 Macro Example Cine a cardiac image What’s wrong with just >display >cine? It cines all the frames. If you do SPECT with heads at 102° you only want frames 42 to 109. You want “wiper” action You can set all these in cine but its not convenient

5 Also.. You might want –some spatial or “temporal” smoothing –truncation (with Tc agents the gallbladder is often much hotter than the heart so it compresses the colour scale horribly… see following images)

6 Frame of cardiac SPECT without truncation, and UL = 100

7 UL brought down to 6 (therefore only ~12 grey levels being used) Not as bad as some we used to get before modifying the patient prep.

8 Here’s the macro…start.; Image Workbench Macro: cine_card.wmf.;.; Initialization *chain=yes *autosave=no Chain means it will jump from the end of one command to the next Autosave = no means that the intermediate files we create will only be temporary. Users usually want it on so we must remember to switch it on at the end

9 .;Set all counts above 30 to 30.; *Image Algebra interactive=no mainfunction=count subfunction=replace ID=ReC countlo=0 countlonew=0 counthi=30 counthinew=30 startimage=1 endimage=2048 startint=1 endint=40 *EOD 30 is locally derived arbitrary level to truncate the counts to. (with 128 matrix, no zoom and 400MBq inj tetrofosmin)

10 .;.;Weiner filter.; *Prefiltering interactive=no filter_type=Wiener dimension=0 mult=default collimator=default isotope=default distance=default field_entry=default hanning=False frame_to_frame=False batch_mode=no *EOD Spatial filter

11 .;Temporal 3 point smooth.; *Image Algebra interactive=no mainfunction=average subfunction=temp_dyn ID=rawdata weightpre=1.000000 weight=2.000000 weightpost=1.000000 *EOD.; Does a 1:2:1 smooth between each pixel and its corresponding pixel in the previous and next projections

12 .; Remove empty frames (102 deg acq.).; *Image Algebra interactive=no mainfunction=edit ID=cine startimage=42 endimage=109 startint=1 endint=40 *EOD.; Remove those pesky blank frames, we could leave them in and tell the cine program not to display them, but why waste disk space?

13 .;Cine the results.; *Cine Version=3 Info=0 Text=2 Total_zones=1 Active_zone=0 All=0 Type_1=0 First_1=1 Last_1=68 Image_Int_1=1 Speed_1=30 Mode_1=2 Zoom_1=128 Scale_1=0 Colorstripe_1=0 Type_2=0 First_2=0 Last_2=0 Image_Int_2=0 Speed_2=6 Mode_2=0 Zoom_2=256 Scale_2=0 Colorstripe_2=0 Type_3=0 First_3=0 Last_3=0 Image_Int_3=0 Speed_3=6 Mode_3=0 Zoom_3=256 Scale_3=0 Colorstripe_3=0 Type_4=0 First_4=0 Last_4=0 Image_Int_4=0 Speed_4=6 Mode_4=0 Zoom_4=256 Scale_4=0 Colorstripe_4=0 Type_5=0 First_5=0 Last_5=0 Image_Int_5=0 Speed_5=6 Mode_5=0 Zoom_5=256 Scale_5=0 Colorstripe_5=0 Type_6=0 First_6=0 Last_6=0 Image_Int_6=0 Speed_6=6 Mode_6=0 Zoom_6=256 Scale_6=0 Colorstripe_6=0 One long cine command, it seems you have to set all 6 possible zones even if 5 are not going to display anything Looks horrible but it was created just by running cine in learn mode.

14 And finally... *autosave=yes Switch auto save back on.

15 Creating the Macro In fact nearly all of it was created by just running through the process with learn mode switched on. Only the truncation level and the Autosave were edited

16 One frame from the result

17 So why cine raw SPECT data anyway? Its useful for the reporter to see problems in the acquisition data before reconstruction turns them into mysterious artifacts! Particularly Movement Attenuation (it is one of the many ruses suggested to help the reporter work out if a defect is real or attenuation, I’ll leave it to you to work out how, personally I prefer Beacon any day)

18 End (you can down-load the macro by right clicking on it, and run it by first removing the.doc extrension.)


Download ppt "Really simple Workbench Macro Mike Avison (apologies to advanced users)"

Similar presentations


Ads by Google