~ubuntu-branches/ubuntu/utopic/mricron/utopic

« back to all changes in this revision

Viewing changes to dcm2nii/convert.pas

  • Committer: Package Import Robot
  • Author(s): Michael Hanke
  • Date: 2012-05-15 08:59:27 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120515085927-l0zoatiwial8v8o1
Tags: 0.20120505.1~dfsg.1-1
* New upstream code (Closes: #671365).
* Update upstream source URL.
* Bumped Standards-version to 3.9.3, no changes necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
END {Diag3D};
93
93
 
94
94
procedure AdjMosaic (var Q: TMatrix; var lDicomData: DicomData);
 
95
//Changes suggested by Antonin Skoch" <ansk@medicon.cz<mailto:ansk@medicon.cz>>
 
96
// September 23, 2011 10:38:05 AM
 
97
var
 
98
   lFactorX: double;
 
99
   lFactorY: double;
 
100
begin
 
101
   lFactorX := (lDicomData.XYZdim[1] -(lDicomData.XYZdim[1]/lDicomData.SiemensMosaicX)   )/2;
 
102
   lFactorY := (lDicomData.XYZdim[2] -(lDicomData.XYZdim[2]/lDicomData.SiemensMosaicY)   )/2;
 
103
   Q.matrix[1,4] :=(Q.matrix[1,1]*lFactorX)+(Q.matrix[1,2]*lFactorY)+Q.matrix[1,4];
 
104
   Q.matrix[2,4] :=(Q.matrix[2,1]*lFactorX)+(Q.matrix[2,2]*lFactorY)+Q.matrix[2,4];
 
105
   Q.matrix[3,4] :=(Q.matrix[3,1]*lFactorX)+(Q.matrix[3,2]*lFactorY)+Q.matrix[3,4];
 
106
end;
 
107
(*procedure AdjMosaic (var Q: TMatrix; var lDicomData: DicomData);
95
108
var
96
109
        lFactor: double;
97
110
begin
99
112
        Q.matrix[1,4] := (Q.matrix[1,1]*lFactor)+(Q.matrix[1,2]*lFactor){+(Q.matrix[1,3])}+Q.matrix[1,4];
100
113
        Q.matrix[2,4] := (Q.matrix[2,1]*lFactor)+(Q.matrix[2,2]*lFactor){+(Q.matrix[1,3])}+Q.matrix[2,4];
101
114
        Q.matrix[3,4] := (Q.matrix[3,1]*lFactor)+(Q.matrix[3,2]*lFactor){+(Q.matrix[1,3])}+Q.matrix[3,4];
102
 
end;
 
115
end;  *)
103
116
 
104
117
(*procedure get_numaris4_val(lFilename,lTagName1,lTagName2: string; var lnmosaic: integer; var lv1,lv2,lv3:single); // spm_dicom_convert
105
118
label 121;
242
255
function IsSiemensDTI(var lDicomData: DicomData;  var lDTI: TDTI;var lFilename: string; var lPrefs: TPrefs): boolean;
243
256
begin
244
257
     result := false;
245
 
 
246
 
     if (lDICOMdata.SiemensDICOMDTI) and (lDicomData.Vers0018_1020 {ImplementationVersion} >= lPrefs.SiemensDTIUse0019If00181020atleast {IgnoreDTIRotationsIf_0002_0013_atleast}) then begin
 
258
     if (lDICOMdata.SiemensDICOMDTI) and (lDICOMdata.DTI[1].bval >= 0) and (lDicomData.Vers0018_1020 {ImplementationVersion} >= lPrefs.SiemensDTIUse0019If00181020atleast {IgnoreDTIRotationsIf_0002_0013_atleast}) then begin
247
259
        lDTI.Bval := lDICOMdata.DTI[1].bval;
248
260
        ldti.v1 := lDicomData.DTI[1].v1;
249
261
        ldti.v2 := lDicomData.DTI[1].v2;
1240
1252
           lDICOMdata.SlicesPer3DVol := round(lnSeries/lVols);
1241
1253
        lDTIra[1].bval := -1; //not DTI
1242
1254
        lDTIdir := 0;
 
1255
 
1243
1256
        IsSiemensDTI(lDicomData,lDTIra[1], lDicomImgName, lPrefs);//see if this is a Siemens DTI image - mosaics in B13, non-mosaic in B12
1244
1257
        if (lDICOMdata.SiemensMosaicX > 1) or (lDICOMdata.SiemensMosaicY > 1) then begin
1245
1258
           lFlipMosaic := IsNormalMosaic(lDicomData,lMosaicSlices, lDicomImgName);
1558
1571
        ExitCode := 0;
1559
1572
end;
1560
1573
 
1561
 
end.
 
1574
end.
 
 
b'\\ No newline at end of file'