fr ?selection doc?[select] fr ?image template?[imgs] rr [imgs-per-row] ?images per row? rr [save-as-spider] ?save as SPIDER (1==Y)? fr ?SPIDER output (optional)?[spider_out] rr [save-as-tiff] ?save as TIFF (1==Y)? fr ?TIFF output (optional)?[tiff_out] fr l [temp_img_stack]_1@ fr l [temp_img_template][temp_img_stack]***** fr l [temp_montage]_2 ; get #images ud n [num-imgs] [select] ; get particle# (x55) ud ic 1,x55 [select] ; get dimensions fi [xdim],[ydim] [imgs]x55 (12,2) ; header locations for NSAM, NROW ; make blank stack ms [temp_img_stack] [xdim],[ydim] ; dimensions [num-imgs] ; #images ; loop through images do lb5 x50=1,[num-imgs] ; get particle# (x55) ud ic x50,x55 [select] ; copy image into memory cp [imgs]x55 [temp_img_template]x50 lb5 ; end image-loop ; generate montage mn s [temp_img_template] (1-[num-imgs]) ; image-range ([imgs-per-row],1) ; imgs/row, margin-width (0.5) ; margin-value [temp_montage] ; OUTPUT ; if SPIDER desired, copy to disk if([save-as-spider].eq.1) then cp [temp_montage] [spider_out] endif ; if TIFF desired, copy to TIFF if([save-as-tiff].eq.1) then cp to tiff [temp_montage] [tiff_out] endif ; clean up de [temp_img_stack] ud ice [select] de [temp_montage] re ; Modified 2009-03-13 ; 2009-03-13 (trs) -- gets image-dimension from file