From e39ef3de2e9cb3441dd2c41b1b29a857ff2cda7b Mon Sep 17 00:00:00 2001 From: Chris Rorden Date: Wed, 13 Jun 2018 14:24:36 -0400 Subject: [PATCH] bump version --- _osx.Rorden.command | 4 +- dcm_load.pas | 2 + define_types.pas | 2 +- mainunit.pas | 14 ++- reorient.pas | 12 ++- scriptengine.pas | 2 +- simplelaz.lpi | 3 + simplelaz.lps | 205 +++++++++++++++++++++++--------------------- texture_3d_unit.pas | 1 - 9 files changed, 136 insertions(+), 109 deletions(-) diff --git a/_osx.Rorden.command b/_osx.Rorden.command index 4421ab0..4513a85 100755 --- a/_osx.Rorden.command +++ b/_osx.Rorden.command @@ -9,7 +9,9 @@ find /Users/rorden/Documents/osx -name ‘*.DS_Store’ -type f -delete #compile dcm2niix cd ~/Documents/cocoa/dcm2niix/console -g++ -O3 -dead_strip -I. main_console.cpp nii_foreign.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp -o dcm2niix -I/usr/local/lib -I/usr/local/include/openjpeg-2.1 /usr/local/lib/libopenjp2.a +#g++ -O3 -dead_strip -I. main_console.cpp nii_foreign.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp -o dcm2niix -I/usr/local/lib -I/usr/local/include/openjpeg-2.1 /usr/local/lib/libopenjp2.a +g++-8 -O3 -dead_strip -I. -std=c++14 -DmyEnableJPEGLS charls/jpegls.cpp charls/jpegmarkersegment.cpp charls/interface.cpp charls/jpegstreamwriter.cpp charls/jpegstreamreader.cpp main_console.cpp nii_foreign.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp -o dcm2niix -I/usr/local/lib -I/usr/local/include/openjpeg-2.1 /usr/local/lib/libopenjp2.a + cp dcm2niix /Users/rorden/Documents/osx/MRIcroGL/dcm2niix cp dcm2niix /Users/rorden/Documents/osx/MRIcroGL/MRIcroGL.app/Contents/Resources/dcm2niix #If we have a 32-bit executable... diff --git a/dcm_load.pas b/dcm_load.pas index 5babfd2..c6eca95 100755 --- a/dcm_load.pas +++ b/dcm_load.pas @@ -74,6 +74,8 @@ function dcmList(dcm2niixExe, dicomDir: string): TStringList; if dcm2niixExe = '' then exit; hProcess := TProcess.Create(nil); hProcess.Executable := dcm2niixExe; + //hprocess.Parameters.Add('-d'); + //hprocess.Parameters.Add('1'); hprocess.Parameters.Add('-n'); hprocess.Parameters.Add('-1'); hprocess.Parameters.Add('-f'); diff --git a/define_types.pas b/define_types.pas index 22cd1eb..da80e34 100755 --- a/define_types.pas +++ b/define_types.pas @@ -12,7 +12,7 @@ interface SysUtils,classes,graphics,userdir,math, {$IFDEF GUI} forms,dialogs,controls;{$ELSE} dialogsx;{$ENDIF} const - kVers = 'v1.0.20180518'; + kVers = 'v1.0.20180606'; NaN : double = 1/0; kMagicDouble : double = -111666222; kTxtFilter = 'Text (*.txt)|*.txt;*.csv|Comma Separated (*.csv)|*.csv'; diff --git a/mainunit.pas b/mainunit.pas index ee150b8..5e1416a 100755 --- a/mainunit.pas +++ b/mainunit.pas @@ -2240,9 +2240,13 @@ procedure TGLForm1.FormCreate(Sender: TObject); writeln('OpenGL 2.1 with 8/8/8/24 bits of R/G/B/Dpth required. Use glxinfo to test capabilities.'); {$ENDIF} {$ENDIF} - if gPrefs.BitDepth = 16 then + if gPrefs.BitDepth = 16 then begin//gPrefs.BitDepth = 16 then + //GLBox.AlphaBits:=0; + //GLBox.RedBits:=5; + //GLBox.GreenBits:=6; + //GLBox.BlueBits:=5; GLbox.DepthBits:= 16 //Some mesa implementations do not support 16 bit depths - else + end else gPrefs.BitDepth := 24; GLbox.AutoResizeViewport:= true; // http://www.delphigl.com/forum/viewtopic.php?f=10&t=11311 GLBox.Parent := GLForm1; @@ -2284,6 +2288,7 @@ procedure TGLForm1.FormCreate(Sender: TObject); //Edit1.visible := false; NewWindow1.Visible:= true; Exit1.visible := false;//with OSX users quit from application menu + Copy1.enabled := false; Copy1.ShortCut:= ShortCut(Word('C'), [ssMeta]); ; Open1.ShortCut := ShortCut(Word('O'), [ssMeta]); Overlays1.ShortCut := ShortCut(Word('O'), [ssShift, ssMeta]); @@ -2844,7 +2849,8 @@ procedure TGLForm1.About1Click(Sender: TObject); +kCR + gShader.Vendor + fpsstr; {$IFDEF LCLCocoa} - ShowAlertSheet(GLForm1.Handle,titleStr, str); + //ShowAlertSheet(GLForm1.Handle,titleStr, str); //limited line length + MessageDlg(titleStr, str,mtInformation,[mbOK],0); {$ELSE} MessageDlg(str,mtInformation,[mbOK],0); {$ENDIF} @@ -5997,7 +6003,7 @@ procedure TGLForm1.FormDropFiles(Sender: TObject; LoadDatasetNIFTIvolx(lFileName,true); exit; end; -//check for NIfTI +//check for DICOM lFilename := dcm2Nifti(dcm2niiForm.getExeName, lFilename); if lFilename = '' then exit; LoadDatasetNIFTIvolx(lFileName,true); diff --git a/reorient.pas b/reorient.pas index 6afe5f8..e06b212 100755 --- a/reorient.pas +++ b/reorient.pas @@ -474,7 +474,6 @@ procedure Resize8(var lHdr: TNIFTIhdr; var lBuffer: bytep; xScale, yScale, zScal if lBuffer^[i] < mn then mn := lBuffer^[i]; if lBuffer^[i] > mx then mx := lBuffer^[i]; end; - Zoom(lHdr,xScale, yScale, zScale); //shrink in 1st dimension : do X as these are contiguous = faster, compute slower dimensions at reduced resolution lXo := lHdr.dim[1]; //input X @@ -503,7 +502,10 @@ procedure Resize8(var lHdr: TNIFTIhdr; var lBuffer: bytep; xScale, yScale, zScal finalImg := tempImgX; goto 666; {$ENDIF} - if ((lYi = lHdr.dim[2]) and (lZi = lHdr.dim[3])) then goto 666; //e.g. 1D image + if ((lYi = lHdr.dim[2]) and (lZi = lHdr.dim[3])) then begin + finalImg := tempImgX; + goto 666; //e.g. 1D image + end; //shrink in 2nd dimension lYo := lHdr.dim[2]; //reduce Y output GetMem( tempImgY,lXo*lYo*lZi*sizeof(single)); //8 @@ -532,7 +534,10 @@ procedure Resize8(var lHdr: TNIFTIhdr; var lBuffer: bytep; xScale, yScale, zScal finalImg := tempImgY; goto 666; {$ENDIF} - if (lZi = lHdr.dim[3]) then goto 666; //e.g. 2D image + if (lZi = lHdr.dim[3]) then begin + finalImg := tempImgY; + goto 666; //e.g. 2D image + end; //shrink the 3rd dimension lZo := lHdr.dim[3]; //reduce Z output GetMem( tempImgZ,lXo*lYo*lZo*sizeof(single)); //8 @@ -710,6 +715,7 @@ procedure Resize24(var lHdr: TNIFTIhdr; var lBuffer: bytep; xScale,yScale, zScal lZi := lHdr.dim[3]; //input Z nVxi := lXi * lYi * lZi; iHdr := lHdr; + //GLForm1.IntensityBox.Caption := floattostr(yScale); for k := 1 to 3 do begin GetMem( img1,nVxi); j := k; diff --git a/scriptengine.pas b/scriptengine.pas index b3f3822..d141c9d 100755 --- a/scriptengine.pas +++ b/scriptengine.pas @@ -1464,7 +1464,7 @@ procedure TScriptForm.FormCreate(Sender: TObject); OpenDialog1.InitialDir := ScriptDir; SaveDialog1.InitialDir := ScriptDir; {$IFDEF Darwin} - + Copy1.enabled := false; Cut1.ShortCut := ShortCut(Word('X'), [ssMeta]); Copy1.ShortCut := ShortCut(Word('C'), [ssMeta]); Paste1.ShortCut := ShortCut(Word('V'), [ssMeta]); diff --git a/simplelaz.lpi b/simplelaz.lpi index f5b39a9..e9eada9 100644 --- a/simplelaz.lpi +++ b/simplelaz.lpi @@ -33,6 +33,9 @@ + + + diff --git a/simplelaz.lps b/simplelaz.lps index e37dc17..8f08cd7 100644 --- a/simplelaz.lps +++ b/simplelaz.lps @@ -3,7 +3,7 @@ - + @@ -20,8 +20,8 @@ - - + + @@ -30,10 +30,9 @@ - + - @@ -48,9 +47,9 @@ - + - + @@ -58,10 +57,11 @@ - - - - + + + + + @@ -70,10 +70,10 @@ - - - - + + + + @@ -86,7 +86,7 @@ - + @@ -98,15 +98,16 @@ - + - - - - + + + + + @@ -156,11 +157,10 @@ - - + + - @@ -230,10 +230,11 @@ - - - - + + + + + @@ -321,11 +322,10 @@ - + - @@ -346,9 +346,11 @@ - - - + + + + + @@ -383,19 +385,18 @@ - + - - - + + @@ -416,10 +417,10 @@ - - - - + + + + @@ -471,16 +472,16 @@ - + - + - + @@ -497,16 +498,16 @@ - + - + - + @@ -520,133 +521,141 @@ - + - + + + + + + + + + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + diff --git a/texture_3d_unit.pas b/texture_3d_unit.pas index 6263efe..fc45d97 100755 --- a/texture_3d_unit.pas +++ b/texture_3d_unit.pas @@ -1152,7 +1152,6 @@ procedure SetOriginXYZ (var lTexture3D: TTexture); exit; {$ELSE} if not NIFTIhdr_LoadImg (lFilename, lHdr, lImgBuffer,lVol) then begin - //exit; if not NIFTIhdr_LoadDummyImg (lHdr, lImgBuffer) then exit; lIsDummy := true;