{This Macros shows you how to apply the in practice the NEWDATAFILE and } {COMPUTEDATA macros } {You need to use the modified 1.61 version in the contribution Folder named as } {Image 1.61Hull.68k } {Programed by Manuel Urrutia Avisrror urrutia@gugu.usal.es } macro 'Rename_Picts/1'; {Rename and Saves a Pict series in the Disk and Folder specified by MyPathName} var i,nStart,nEnd,PicNum:integer; PicName,MyPicName,MyPathName, PicTitle:string; BEGIN RequiresVersion(1.61); PicNum:= nPics; if PicNum = 0 then Exit('Load First the Picts to Rename'); MyPicName:= GetString('Name of the Pict Series','KIDNEY'); MyPathName:= GetString('Path of the Pict Series','HD 230:ImagePicts:'); PicName:= MyPicName; nStart:= GetNumber('Start Pict Number',1,0); nEnd:= GetNumber('End Pict Number',4,0); if (nEnd - nStart + 1) > PicNum then nEnd:= nStart + PicNum - 1; FOR i:= nStart to nEnd DO begin SetPicName(MyPicName,i:3); PicTitle:= WindowTitle; MyPicName:= concat(MyPathName,PicTitle); SetSaveAs('PICT'); SaveAs(MyPicName); PicTitle:=''; MyPicName:= PicName; Dispose; end; END; macro 'Create_DataFile/2'; {Creates a new read/write sequential access data file} var myDataFile:string; begin RequiresVersion(1.61); MyDataFile:= GetString('Name of the Data File','Path:MyDataFile'); NewDataFile(MyDataFile); end; macro 'ComputePictData_FromWindow/3'; {Process and computes data from images in memory} var i,nP:integer; myDataFile:string; begin RequiresVersion(1.61); MyDataFile:= GetString('Name of the Data File','HD 230:MyDataFile'); NewDataFile(MyDataFile); nP:= GetNumber('Enter Number of Picts in Memory to Process',50,0); if nPics = 0 then Exit('Load First the Picts to Process'); SetPrecision(2,9); for i:= 1 to nP do begin SelectPic(i); SetDensitySlice(224,254);{add other process macros as needed} SetOptions('AreaLengthMajorMinorAngleUser1User2'); AdjustAreas(true); AnalyzeParticles('OutlineIgnoreIncludeReset'); ComputeData('MeanSdevSkeewCurtosisLabelsStandardSmallTen'); RevertToSaved; end; end; macro 'ComputePictData_FromDisk/4'; {Process and computes data from images stored in Disk} var i,n,v,sPict,ePict:integer; MyDataFile,MyFile:string; begin RequiresVersion(1.61); sPict:= GetNumber('Start Pict Number',1,0); ePict:= GetNumber('End Pict Number',50,0); DisposeAll; {Close All Windows} MyDataFile:= GetString('Path and Name of the Data File','HD 230:MyDataFile'); NewDataFile(MyDataFile); {creates the data file} MyFile:=GetString('Path and Name of the Picts', 'HD 230:ImagePicts:KIDNEY'); SetPrecision(2,9); for i:= sPict to ePict do begin Open(MyFile,i:3); {Sequentially Opens KIDNEY001,KIDNEY002 ..... KIDNEY004} SelectPic(1); {Just in case} SetDensitySlice(224,254); {add other process macros as needed} SetOptions('AreaLengthMajorMinorAngleUser1User2'); AdjustAreas(true); AnalyzeParticles('OutlineIgnoreIncludeReset'); ComputeData('MeanSdevSkeewCurtosisLabelsStandardSmallTen'); Dispose; {Don't use Revert because it gives an File I/O - 51 = Bad RefNum} end; end;