CanvasWidth:=ImgGetWidth(_CurrentImage);
CanvasHeight:=ImgGetHeight(_CurrentImage);
newwidth:=CanvasWidth div 2 ;
newHeight:=CanvasHeight ;
rightImage:=ImgCopy(_CurrentImage,newwidth,0,CanvasWidth,CanvasHeight);
leftImage:=ImgCopy(_CurrentImage,0,0,newwidth,CanvasHeight);
oldfilename:=ExtractFileName(_CurrentInputFile) ;
oldfileext:=ExtractFileExt(_CurrentInputFile)  ;
newrightimgname:=oldfilename+'-right'+oldfileext ;
Outputfolder:='C:\';
rightFileName:=Outputfolder+'\'+ newrightimgname;
ImgSaveAsTif(rightImage,rightFileName,0,0);
ImgDelete(rightImage);
newleftimgname:=oldfilename+'-left'+oldfileext ;
leftFileName:=Outputfolder+'\'+ newleftimgname;
ImgSaveAsTif(leftImage,leftFileName,0,0);
ImgDelete(leftImage);
