/* ** SaveAsFRAMESTORE.fred ** ** $VER: SaveAsFRAMESTORE.fred 1.1.0 (24.10.93) ** ** This program can be run from an InvokeADPro list to save images in ** FRAMESTORE format. Including this program automatically causes a pre script ** to be executed as well (to select the FRAMESTORE file extension). ** ** It is up to the user to include the necessary scripts to create raw or ** rendered data. This script will only try to save out what you tell it, ** and not do any error detecting regarding what type of image data is ** available. ** ** Clips Imported: ** FREDFSFilter - Level of filtering. ** FREDFSCompress - Level of compression. ** FREDFSFNameSelect - String describing how the filename ** should be modified ** FREDFSSeqFileSelect - Name of sequence file ** ** NOTE: Clip names are case sensitive. ** ** This script requires FRED v1.4.0 (or higher) to run. Also required is ** ADPro v2.5.0 (or higher). ** ** Copyright © 1993 ASDG, Incorporated ** All Rights Reserved */ ADDRESS "ADPro" OPTIONS RESULTS PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell NL = '0A'X SQ = '27'X DQ = '22'X TRUE = 1 FALSE = 0 FrameFName = STRIP(STRIP(FrameFName , "B" , " ") , "B" , '"') /* ** Get the required parameters. Error if any are missing. */ Filter = GETCLIP( "FREDFSFilter" ) IF (Filter = "") THEN DO ADPRO_TO_FRONT OKAY1 "Required clip, FREDFSFilter," || NL ||, "is not specified." SCREEN_TO_FRONT "FRED" EXIT 10 END Compress = GETCLIP( "FREDFSCompress" ) IF (Compress = "") THEN DO ADPRO_TO_FRONT OKAY1 "Required clip, FREDFSCompress," || NL ||, "is not specified." SCREEN_TO_FRONT "FRED" EXIT 10 END FNameSelect = GETCLIP( "FREDFSFNameSelect" ) IF (FNameSelect = "") THEN DO ADPRO_TO_FRONT OKAY1 "Required clip, FREDFSFNameSelect," || NL ||, "is not specified." SCREEN_TO_FRONT "FRED" EXIT 10 END SeqFileSelect = GETCLIP( "FREDFSSeqFileSelect" ) IF (SeqFileSelect = "") THEN DO ADPRO_TO_FRONT OKAY1 "Required clip, FREDFSSeqFileSelect," || NL ||, "is not specified." SCREEN_TO_FRONT "FRED" EXIT 10 END /* ** See what type of data is loaded in ADPro/MorphPlus. */ CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE IF (RESULT ~= 0) THEN EXIT 10 /* ** Do the save. If we aren't using the same filename, we will use the ** same basename and make every effort possible to replace the ** perceived filename extension with the selected FRAMESTORE extension. */ CALL "FREDSCRIPTS:FREDFunctions/ModifyFilename" FNameSelect '"'FrameFName'"' FrameNum FALSE NewFName = '"'RESULT'"' SAVER "FRAMESTORE" NewFName "RAW", "FILTER" Filter, "COMPRESS" Compress IF (RC ~= 0) THEN DO Why = ADPRO_RESULT ADPRO_TO_FRONT OKAY1 "FRAMESTORE save failed:" || NL || Why || NL ||, "Argument Information:" || NL ||, "Filename = " || NewFName || NL ||, "Type = " || "RAW" || NL ||, "Filter = " || Filter || NL ||, "Compression = " || Compress SCREEN_TO_FRONT "FRED" EXIT 10 END CALL "FREDSCRIPTS:FREDFunctions/SeqFileAppend" SeqFileSelect NewFName 1 EXIT 0