New upstream version 2.8.7
Gert Wollny
5 years ago
815 | 815 | } |
816 | 816 | if( !found ) |
817 | 817 | { |
818 | std::cout << "no pdb tag found" << std::endl; | |
818 | std::cerr << "no pdb tag found" << std::endl; | |
819 | 819 | ret = 1; |
820 | 820 | } |
821 | 821 | |
900 | 900 | found = true; |
901 | 901 | if( csa.GetFormat() == gdcm::CSAHeader::ZEROED_OUT ) |
902 | 902 | { |
903 | std::cout << "CSA Header has been zero-out (contains only 0)" << std::endl; | |
903 | std::cerr << "CSA Header has been zero-out (contains only 0)" << std::endl; | |
904 | 904 | ret = 1; |
905 | 905 | } |
906 | 906 | else if( csa.GetFormat() == gdcm::CSAHeader::DATASET_FORMAT ) |
919 | 919 | found = true; |
920 | 920 | if( csa.GetFormat() == gdcm::CSAHeader::ZEROED_OUT ) |
921 | 921 | { |
922 | std::cout << "CSA Header has been zero-out (contains only 0)" << std::endl; | |
922 | std::cerr << "CSA Header has been zero-out (contains only 0)" << std::endl; | |
923 | 923 | ret = 1; |
924 | 924 | } |
925 | 925 | else if( csa.GetFormat() == gdcm::CSAHeader::DATASET_FORMAT ) |
938 | 938 | found = true; |
939 | 939 | if( csa.GetFormat() == gdcm::CSAHeader::ZEROED_OUT ) |
940 | 940 | { |
941 | std::cout << "CSA Header has been zero-out (contains only 0)" << std::endl; | |
941 | std::cerr << "CSA Header has been zero-out (contains only 0)" << std::endl; | |
942 | 942 | ret = 1; |
943 | 943 | } |
944 | 944 | else if( csa.GetFormat() == gdcm::CSAHeader::INTERFILE ) |
957 | 957 | } |
958 | 958 | if( !found ) |
959 | 959 | { |
960 | std::cout << "no csa tag found" << std::endl; | |
960 | std::cerr << "no csa tag found" << std::endl; | |
961 | 961 | ret = 1; |
962 | 962 | } |
963 | 963 |
282 | 282 | std::string str; |
283 | 283 | //ss >> str; |
284 | 284 | std::getline(ss, str); // do not skip whitespace |
285 | if( str.size() % 2 == 1 ) str += " "; | |
285 | 286 | keys.push_back( std::make_pair(tag, str) ); |
286 | 287 | } |
287 | 288 | else if( option_index == 20 ) /* port-scp */ |
39 | 39 | #---------------------------------------------------------------------------- |
40 | 40 | set(GDCM_MAJOR_VERSION 2) |
41 | 41 | set(GDCM_MINOR_VERSION 8) |
42 | set(GDCM_BUILD_VERSION 6) | |
42 | set(GDCM_BUILD_VERSION 7) | |
43 | 43 | set(GDCM_VERSION |
44 | 44 | "${GDCM_MAJOR_VERSION}.${GDCM_MINOR_VERSION}.${GDCM_BUILD_VERSION}") |
45 | 45 | # let advanced user the option to define GDCM_API_VERSION: |
1722 | 1722 | {0x07a1,0x002b,"ELSCINT1",VR::CS,VM::VM1,"?",false }, |
1723 | 1723 | {0x07a1,0x0036,"ELSCINT1",VR::AE,VM::VM1,"Tamar Source Ae",false }, |
1724 | 1724 | {0x07a1,0x0040,"ELSCINT1",VR::CS,VM::VM1,"Tamar Study Body Part",false }, |
1725 | {0x07a1,0x0042,"ELSCINT1",VR::SH,VM::VM1,"?",false }, | |
1725 | 1726 | {0x07a1,0x0043,"ELSCINT1",VR::IS,VM::VM1,"?",false }, |
1726 | 1727 | {0x07a1,0x0047,"ELSCINT1",VR::CS,VM::VM1,"?orientation?",false }, |
1727 | 1728 | {0x07a1,0x0050,"ELSCINT1",VR::US,VM::VM1,"Tamar Site Id",false }, |
1736 | 1737 | {0x07a1,0x0088,"ELSCINT1",VR::US,VM::VM1,"?",false }, |
1737 | 1738 | {0x07a1,0x0098,"ELSCINT1",VR::US,VM::VM1,"?",false }, |
1738 | 1739 | {0x07a1,0x009f,"ELSCINT1",VR::CS,VM::VM1,"?",false }, |
1740 | {0x07a1,0x00d0,"ELSCINT1",VR::LO,VM::VM1,"?",false }, | |
1739 | 1741 | {0x07a3,0x0001,"ELSCINT1",VR::LO,VM::VM1,"Tamar Exe Software Version",false }, |
1740 | 1742 | {0x07a3,0x0003,"ELSCINT1",VR::CS,VM::VM1,"Tamar Study Has Sticky Note",false }, |
1741 | 1743 | {0x07a3,0x0005,"ELSCINT1",VR::CS,VM::VM1,"?",false }, |
1749 | 1751 | {0x07a3,0x001c,"ELSCINT1",VR::ST,VM::VM1,"?patient name?",false }, |
1750 | 1752 | {0x07a3,0x001d,"ELSCINT1",VR::ST,VM::VM1,"?radiologist name?",false }, |
1751 | 1753 | {0x07a3,0x001e,"ELSCINT1",VR::ST,VM::VM1,"?num?",false }, |
1754 | {0x07a3,0x001f,"ELSCINT1",VR::ST,VM::VM1,"?",false }, | |
1755 | {0x07a3,0x0022,"ELSCINT1",VR::ST,VM::VM1,"?",false }, | |
1752 | 1756 | {0x07a3,0x0023,"ELSCINT1",VR::ST,VM::VM1,"?+sign?",false }, |
1757 | {0x07a3,0x0024,"ELSCINT1",VR::ST,VM::VM1,"?",false }, | |
1753 | 1758 | {0x07a3,0x0034,"ELSCINT1",VR::SH,VM::VM1,"Tamar Study Age",false }, |
1754 | 1759 | {0x07a3,0x0043,"ELSCINT1",VR::DS,VM::VM1_n,"?",false }, |
1760 | {0x07a3,0x0052,"ELSCINT1",VR::LO,VM::VM1,"?",false }, | |
1755 | 1761 | {0x07a3,0x0055,"ELSCINT1",VR::SH,VM::VM1,"?",false }, |
1762 | {0x07a3,0x005c,"ELSCINT1",VR::ST,VM::VM1,"?",false }, | |
1756 | 1763 | {0x07a3,0x0061,"ELSCINT1",VR::LT,VM::VM1,"?",false }, |
1757 | 1764 | {0x07a3,0x0062,"ELSCINT1",VR::SQ,VM::VM1,"?",false }, |
1758 | 1765 | {0x07a3,0x0063,"ELSCINT1",VR::SQ,VM::VM1,"?",false }, |
1759 | 1766 | {0x07a3,0x0064,"ELSCINT1",VR::IS,VM::VM1_n,"?",false }, |
1760 | 1767 | {0x07a3,0x0065,"ELSCINT1",VR::CS,VM::VM1_n,"?yes/no bool?",false }, |
1761 | 1768 | {0x07a3,0x0066,"ELSCINT1",VR::IS,VM::VM1,"?",false }, |
1769 | {0x07a3,0x008f,"ELSCINT1",VR::CS,VM::VM1,"?",false }, | |
1762 | 1770 | {0x07a3,0x0099,"ELSCINT1",VR::CS,VM::VM1,"?yes/no bool?",false }, |
1763 | 1771 | {0x07a3,0x009c,"ELSCINT1",VR::CS,VM::VM1,"?yes/no bool?",false }, |
1764 | 1772 | {0x07a3,0x009f,"ELSCINT1",VR::CS,VM::VM1,"?",false }, |
1778 | 1786 | {0x07a3,0x00cb,"ELSCINT1",VR::SQ,VM::VM1,"?network seq11?",false }, |
1779 | 1787 | {0x07a3,0x00cc,"ELSCINT1",VR::LO,VM::VM1,"Tamar Grid Token Version",false }, |
1780 | 1788 | {0x07a5,0x0000,"ELSCINT1",VR::LO,VM::VM1,"?",false }, |
1789 | {0x07a5,0x0054,"ELSCINT1",VR::DT,VM::VM1,"?",false }, | |
1781 | 1790 | {0x07a5,0x0056,"ELSCINT1",VR::CS,VM::VM1,"?",false }, |
1791 | {0x07a5,0x0063,"ELSCINT1",VR::CS,VM::VM1_n,"?",false }, | |
1782 | 1792 | {0x07a5,0x0069,"ELSCINT1",VR::LO,VM::VM1,"?",false }, |
1793 | {0x07a5,0x00c8,"ELSCINT1",VR::CS,VM::VM1,"?",false }, | |
1783 | 1794 | {0x5001,0x0070,"ELSCINT1",VR::SQ,VM::VM1,"?",false }, |
1784 | 1795 | {0x5001,0x0071,"ELSCINT1",VR::SH,VM::VM1,"?",false }, |
1785 | 1796 | {0x5001,0x0080,"ELSCINT1",VR::SQ,VM::VM1,"?",false }, |
6044 | 6055 | {0x200b,0x0099,"Philips RAD Imaging DD 097",VR::SH,VM::VM1,"?",false }, |
6045 | 6056 | {0x200b,0x009a,"Philips RAD Imaging DD 097",VR::FD,VM::VM1,"?",false }, |
6046 | 6057 | {0x200b,0x009b,"Philips RAD Imaging DD 097",VR::FD,VM::VM1,"?",false }, |
6058 | {0x200b,0x009f,"Philips RAD Imaging DD 097",VR::SQ,VM::VM1,"?",false }, | |
6047 | 6059 | {0x200b,0x00a0,"Philips RAD Imaging DD 097",VR::LT,VM::VM1,"?",false }, |
6060 | {0x200b,0x00a1,"Philips RAD Imaging DD 097",VR::CS,VM::VM1,"?bool?",false }, | |
6048 | 6061 | {0x0031,0x0030,"Philips US Imaging 60",VR::UL,VM::VM1,"Private data",false }, |
6049 | 6062 | {0x0031,0x0031,"Philips US Imaging 60",VR::UL,VM::VM1,"Private data",false }, |
6050 | 6063 | {0x200d,0x0005,"Philips US Imaging DD 017",VR::LO,VM::VM1,"?",false }, |
35 | 35 | { |
36 | 36 | return floor(n * pow(10., d) + .5) / pow(10., d); |
37 | 37 | } |
38 | ||
39 | struct dircos_key { | |
40 | double dircos[6]; | |
41 | void read( const std::string & str ) { | |
42 | DirectionCosines dc; | |
43 | dc.SetFromString( str.c_str() ); | |
44 | const double * ptr = dc; | |
45 | memcpy( dircos, ptr, sizeof(dircos) ); | |
46 | } | |
47 | }; | |
48 | ||
49 | struct dircos_comp { | |
50 | bool operator()( dircos_key const & lhs, dircos_key const & rhs ) { | |
51 | const double *iop1 = lhs.dircos; | |
52 | const double *iop2 = rhs.dircos; | |
53 | return std::lexicographical_compare(iop1, iop1+6, | |
54 | iop2, iop2+6); | |
55 | } | |
56 | }; | |
38 | 57 | |
39 | 58 | bool IPPSorter::Sort(std::vector<std::string> const & filenames) |
40 | 59 | { |
87 | 106 | { |
88 | 107 | if( iops.size() != 1 ) |
89 | 108 | { |
90 | gdcmDebugMacro( "More than one IOP (or no IOP): " << iops.size() ); | |
91 | //std::copy(iops.begin(), iops.end(), std::ostream_iterator<std::string>(std::cout, "\n")); | |
92 | return false; | |
109 | std::set< dircos_key, dircos_comp > s; | |
110 | for( Scanner::ValuesType::const_iterator it = iops.begin(); it != iops.end(); ++it ) | |
111 | { | |
112 | dircos_key dk; | |
113 | dk.read( *it ); | |
114 | s.insert( dk ); | |
115 | } | |
116 | // sometime we want to handle: | |
117 | // iops = {[0] = "1\\0\\0\\0\\1\\-0", [1] = "1\\0\\0\\0\\1\\0 "} | |
118 | if( s.size() != 1 ) | |
119 | { | |
120 | gdcmDebugMacro( "More than one IOP (or no IOP): " << iops.size() << ". Try changing DirCosTolerance" ); | |
121 | return false; | |
122 | } | |
93 | 123 | } |
94 | 124 | } |
95 | 125 | const size_t fsize = frames.size(); // Should I really tolerate issue with Frame of Reference UID ? |
772 | 772 | #endif |
773 | 773 | { |
774 | 774 | { |
775 | Attribute<0x0028,0x0011> at = { 0 }; | |
775 | Attribute<0x0028,0x0011> at = { 0 }; // Columns | |
776 | 776 | at.SetFromDataSet( ds ); |
777 | 777 | theReturn[0] = at.GetValue(); |
778 | 778 | } |
779 | 779 | { |
780 | Attribute<0x0028,0x0010> at = { 0 }; | |
780 | Attribute<0x0028,0x0010> at = { 0 }; // Rows | |
781 | 781 | at.SetFromDataSet( ds ); |
782 | 782 | theReturn[1] = at.GetValue(); |
783 | 783 | } |
1031 | 1031 | } |
1032 | 1032 | assert( bitsallocated % 8 == 0 ); |
1033 | 1033 | // eg. fragment_size == 63532 and 181 * 117 * 3 * 8 == 63531 ... |
1034 | assert( ((fragment_size + 1)/2 ) * 2 == ((image_height * image_width * numcomps * (bitsallocated/8) + 1)/ 2 )* 2 ); | |
1034 | assert( ((fragment_size + 1)/2 ) * 2 == (((size_t)image_height * image_width * numcomps * (bitsallocated/8) + 1)/ 2 )* 2 ); | |
1035 | 1035 | int subsampling_dx = parameters->subsampling_dx; |
1036 | 1036 | int subsampling_dy = parameters->subsampling_dy; |
1037 | 1037 |
15 | 15 | #include "gdcmAttribute.h" |
16 | 16 | #include "gdcmImageHelper.h" |
17 | 17 | #include "gdcmDirectionCosines.h" |
18 | #include "gdcmAnonymizer.h" | |
19 | 18 | |
20 | 19 | #include <math.h> |
21 | 20 | |
47 | 46 | return true; |
48 | 47 | } |
49 | 48 | |
50 | #ifdef SNVINVERT | |
51 | 49 | static bool reorganize_mosaic_invert(const unsigned short *input, const unsigned int *inputdims, |
52 | 50 | unsigned int square, const unsigned int *outputdims, unsigned short *output ) |
53 | 51 | { |
66 | 64 | } |
67 | 65 | return true; |
68 | 66 | } |
69 | #endif | |
70 | 67 | |
71 | 68 | } |
72 | 69 | |
75 | 72 | I = image; |
76 | 73 | } |
77 | 74 | |
78 | bool SplitMosaicFilter::ComputeMOSAICDimensions( unsigned int dims[3] ) | |
79 | { | |
75 | bool SplitMosaicFilter::GetAcquisitionSize(unsigned int size[2], DataSet const & ds) | |
76 | { | |
77 | bool found = true; | |
78 | /* | |
79 | Dimensions of the acquired frequency /phase data before reconstruction. | |
80 | Multi-valued: frequency rows\frequency columns\phase rows\phase columns. | |
81 | */ | |
82 | Attribute<0x0018, 0x1310> acquisitionMatrix; | |
83 | acquisitionMatrix.SetFromDataSet( ds ); | |
84 | const unsigned short *pMat = acquisitionMatrix.GetValues(); | |
85 | /* | |
86 | The axis of phase encoding with respect to the image. | |
87 | ||
88 | Enumerated Values: | |
89 | ||
90 | ROW | |
91 | phase encoded in rows. | |
92 | ||
93 | COL | |
94 | phase encoded in columns. | |
95 | */ | |
96 | Attribute<0x0018, 0x1312> inPlanePhaseEncodingDirection; | |
97 | inPlanePhaseEncodingDirection.SetFromDataSet( ds ); | |
98 | CSComp val = inPlanePhaseEncodingDirection.GetValue(); | |
99 | std::string dir = val.Trim(); | |
100 | // http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.3.html | |
101 | if( dir == "COL" ) | |
102 | { | |
103 | /* pay attention that size is: { columns , rows } */ | |
104 | // [256\0\0\134] | |
105 | size[0] = pMat[3]; | |
106 | size[1] = pMat[0]; | |
107 | } | |
108 | else if( dir == "ROW" ) | |
109 | { | |
110 | // [0\512\213\0] | |
111 | size[0] = pMat[1]; | |
112 | size[1] = pMat[2]; | |
113 | } | |
114 | else | |
115 | { | |
116 | size[0] = size[1] = 0; | |
117 | } | |
118 | found = size[0] && size[1]; | |
119 | return found; | |
120 | } | |
121 | ||
122 | unsigned int SplitMosaicFilter::GetNumberOfImagesInMosaic( File const & file ) | |
123 | { | |
124 | unsigned int numberOfImagesInMosaic = 0; | |
125 | DataSet const &ds = file.GetDataSet(); | |
80 | 126 | CSAHeader csa; |
81 | DataSet& ds = GetFile().GetDataSet(); | |
82 | 127 | |
83 | 128 | const PrivateTag &t1 = csa.GetCSAImageHeaderInfoTag(); |
84 | int numberOfImagesInMosaic = 0; | |
85 | 129 | if( csa.LoadFromDataElement( ds.GetDataElement( t1 ) ) ) |
86 | 130 | { |
87 | 131 | if( csa.FindCSAElementByName( "NumberOfImagesInMosaic" ) ) |
95 | 139 | } |
96 | 140 | } |
97 | 141 | } |
98 | else | |
142 | // try harder: | |
143 | if( !numberOfImagesInMosaic ) | |
99 | 144 | { |
100 | 145 | // Some weird anonymizer remove the private creator but leave the actual element. |
101 | 146 | // oh well, let try harder: |
115 | 160 | } |
116 | 161 | } |
117 | 162 | } |
163 | ||
164 | std::vector<unsigned int> colrow = | |
165 | ImageHelper::GetDimensionsValue( file ); | |
166 | ||
167 | // try super harder. Pay attention that trailing black image cannot be removed here. | |
118 | 168 | if( !numberOfImagesInMosaic ) |
119 | 169 | { |
120 | gdcmErrorMacro( "Could not find NumberOfImagesInMosaic" ); | |
170 | unsigned int mosaicSize[2]; | |
171 | if( GetAcquisitionSize(mosaicSize, ds) ) | |
172 | { | |
173 | if( colrow[0] % mosaicSize[0] == 0 && | |
174 | colrow[1] % mosaicSize[1] == 0 ) | |
175 | { | |
176 | numberOfImagesInMosaic = | |
177 | colrow[0] / mosaicSize[0] * | |
178 | colrow[1] / mosaicSize[1]; | |
179 | // MultiFrame will contain trailing empty slices: | |
180 | gdcmWarningMacro( "NumberOfImagesInMosaic was not found. Volume will be padded with black image." ); | |
181 | } | |
182 | else | |
183 | { | |
184 | // assume interpolation: | |
185 | unsigned int mosSize = std::max( mosaicSize[0], mosaicSize[1] ); | |
186 | if( colrow[0] % mosSize == 0 && | |
187 | colrow[1] % mosSize == 0 ) | |
188 | { | |
189 | gdcmDebugMacro( "Matrix Acquisition does not match exactly. Using max value." ); | |
190 | numberOfImagesInMosaic = | |
191 | colrow[0] / mosSize * | |
192 | colrow[1] / mosSize; | |
193 | // MultiFrame will contain trailing empty slices: | |
194 | gdcmWarningMacro( "NumberOfImagesInMosaic was not found. Volume will be padded with black image." ); | |
195 | } | |
196 | else | |
197 | { | |
198 | gdcmErrorMacro( "NumberOfImagesInMosaic cannot be computed from Img Acq: " << mosaicSize[0] << "," << mosaicSize[1] ); | |
199 | } | |
200 | } | |
201 | } | |
202 | } | |
203 | return numberOfImagesInMosaic; | |
204 | } | |
205 | ||
206 | bool SplitMosaicFilter::ComputeMOSAICDimensions( unsigned int dims[3] ) | |
207 | { | |
208 | unsigned int numberOfImagesInMosaic = GetNumberOfImagesInMosaic( GetFile() ); | |
209 | ||
210 | if( !numberOfImagesInMosaic ) | |
211 | { | |
212 | gdcmErrorMacro( "Could not find/compute NumberOfImagesInMosaic" ); | |
121 | 213 | return false; |
122 | 214 | } |
123 | 215 | |
124 | 216 | std::vector<unsigned int> colrow = |
125 | 217 | ImageHelper::GetDimensionsValue( GetFile() ); |
218 | ||
126 | 219 | dims[0] = colrow[0]; |
127 | 220 | dims[1] = colrow[1]; |
128 | 221 | |
170 | 263 | double z[3]; |
171 | 264 | dc.Cross (z); |
172 | 265 | const double snv_dot = dc.Dot( normal, z ); |
173 | if( (1. - snv_dot) < 1e-6 ) | |
266 | if( fabs(1. - snv_dot) < 1e-6 ) | |
174 | 267 | { |
175 | 268 | gdcmDebugMacro("Same direction"); |
176 | 269 | inverted = false; |
177 | 270 | } |
178 | else if( (-1. - snv_dot) < 1e-6 ) | |
271 | else if( fabs(-1. - snv_dot) < 1e-6 ) | |
179 | 272 | { |
180 | 273 | gdcmWarningMacro("SliceNormalVector is opposite direction"); |
181 | 274 | inverted = true; |
250 | 343 | const unsigned int div = (unsigned int )ceil(sqrt( (double)dims[2]) ); |
251 | 344 | bool inverted; |
252 | 345 | double normal[3]; |
346 | bool hasOriginCSA = true; | |
347 | bool hasNormalCSA = true; | |
253 | 348 | if( !ComputeMOSAICSliceNormal( normal, inverted ) ) |
254 | 349 | { |
255 | return false; | |
256 | } | |
350 | gdcmDebugMacro( "Normal will not be accurate" ); | |
351 | hasNormalCSA = false; | |
352 | } | |
353 | (void)hasNormalCSA; | |
257 | 354 | double origin[3]; |
258 | 355 | if( !ComputeMOSAICSlicePosition( origin, inverted ) ) |
259 | 356 | { |
260 | return false; | |
357 | gdcmWarningMacro( "Origin will not be accurate" ); | |
358 | hasOriginCSA = false; | |
261 | 359 | } |
262 | 360 | |
263 | 361 | const Image &inputimage = GetImage(); |
276 | 374 | outbuf.resize(l); |
277 | 375 | |
278 | 376 | bool b; |
279 | #ifdef SNVINVERT | |
280 | 377 | if( inverted ) |
281 | 378 | { |
282 | 379 | b = details::reorganize_mosaic_invert( |
284 | 381 | (unsigned short*)&outbuf[0] ); |
285 | 382 | } |
286 | 383 | else |
287 | #endif | |
288 | 384 | { |
289 | 385 | b = details::reorganize_mosaic( |
290 | 386 | (unsigned short*)&buf[0], inputimage.GetDimensions(), div, dims, |
311 | 407 | image.SetDimension(2, dims[2] ); |
312 | 408 | |
313 | 409 | // Fix origin (direction is ok since we reorganize the tiles): |
410 | if( hasOriginCSA ) | |
314 | 411 | image.SetOrigin( origin ); |
315 | 412 | |
316 | 413 | PhotometricInterpretation pi; |
32 | 32 | * Siemens CSA Image Header |
33 | 33 | * CSA:= Common Siemens Architecture, sometimes also known as Common syngo Architecture |
34 | 34 | * |
35 | * \warning when private attributes are not found, the acquisition matrix is | |
36 | * used to compute the NumberOfImagesInMosaic. This means trailing black slices | |
37 | * will be considered in the volume (instead of discarded). | |
38 | * CSA 0029,1010 is needed for correct NumberOfImagesInMosaic | |
39 | * CSA 0029,1020 is needed to compute the correct origin | |
40 | * without above info default are taken (may not be accurate). | |
35 | 41 | */ |
36 | 42 | class GDCM_EXPORT SplitMosaicFilter |
37 | 43 | { |
60 | 66 | File &GetFile() { return *F; } |
61 | 67 | const File &GetFile() const { return *F; } |
62 | 68 | |
69 | /// Get the Acquisition Matrix (non zero value): | |
70 | static bool GetAcquisitionSize(unsigned int size[2], DataSet const & ds); | |
71 | ||
72 | /// Return the value for NumberOfImagesInMosaic, or compute it from Acquisition Size | |
73 | static unsigned int GetNumberOfImagesInMosaic( File const & file ); | |
74 | ||
63 | 75 | protected: |
64 | 76 | |
65 | 77 | private: |
585 | 585 | if( darray ) |
586 | 586 | { |
587 | 587 | double tuple[3]; |
588 | #if VTK_MAJOR_VERSION > 7 || (VTK_MAJOR_VERSION == 7 && VTK_MINOR_VERSION >= 1) | |
589 | darray->GetTypedTuple( 0, tuple ); | |
590 | #else | |
588 | 591 | darray->GetTupleValue( 0, tuple ); |
592 | #endif | |
589 | 593 | intcolor[0] = (int32_t)(tuple[0] * 255.); |
590 | 594 | intcolor[1] = (int32_t)(tuple[1] * 255.); |
591 | 595 | intcolor[2] = (int32_t)(tuple[2] * 255.); |
593 | 597 | else if( farray ) |
594 | 598 | { |
595 | 599 | float ftuple[3]; |
600 | #if VTK_MAJOR_VERSION > 7 || (VTK_MAJOR_VERSION == 7 && VTK_MINOR_VERSION >= 1) | |
601 | farray->GetTypedTuple( 0, ftuple ); | |
602 | #else | |
596 | 603 | farray->GetTupleValue( 0, ftuple ); |
604 | #endif | |
597 | 605 | intcolor[0] = (int32_t)(ftuple[0] * 255.); |
598 | 606 | intcolor[1] = (int32_t)(ftuple[1] * 255.); |
599 | 607 | intcolor[2] = (int32_t)(ftuple[2] * 255.); |
303 | 303 | # -> http://stackoverflow.com/a/16605034/136285 ?? |
304 | 304 | endif() |
305 | 305 | endif() |
306 | if(XSLT_PROCESSOR) | |
307 | configure_file(version.txt.in | |
308 | version.txt @ONLY) | |
309 | foreach(docbook ${MANPAGES_XML}) | |
310 | add_custom_command( | |
311 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${docbook}.1 | |
312 | COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/man/${docbook}.xml ${CMAKE_CURRENT_BINARY_DIR}/${docbook}.xml | |
313 | COMMAND ${XSLT_PROCESSOR} ${XSLT_PROCESSOR_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${docbook}.xml | |
314 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man/${docbook}.xml | |
315 | ) | |
316 | list(APPEND MANPAGES | |
317 | ${CMAKE_CURRENT_BINARY_DIR}/${docbook}.1 | |
318 | ) | |
319 | endforeach() | |
320 | add_custom_target(DOCBOOK_MANPAGES | |
321 | ALL | |
322 | DEPENDS ${MANPAGES} | |
323 | COMMENT "docbook manpages" | |
324 | ) | |
325 | install(FILES | |
326 | ${MANPAGES} | |
327 | DESTINATION ${GDCM_INSTALL_MAN_DIR}/man1 COMPONENT DebugDevel | |
328 | ) | |
329 | else() | |
330 | message(WARNING "Cannot build man page from docbook (need an XSL processor)") | |
331 | endif() | |
306 | if(XSLT_PROCESSOR) | |
307 | configure_file(version.txt.in | |
308 | version.txt @ONLY) | |
309 | foreach(docbook ${MANPAGES_XML}) | |
310 | add_custom_command( | |
311 | OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${docbook}.1 | |
312 | COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/man/${docbook}.xml ${CMAKE_CURRENT_BINARY_DIR}/${docbook}.xml | |
313 | COMMAND ${XSLT_PROCESSOR} ${XSLT_PROCESSOR_ARG} ${CMAKE_CURRENT_BINARY_DIR}/${docbook}.xml | |
314 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/man/${docbook}.xml | |
315 | ) | |
316 | list(APPEND MANPAGES | |
317 | ${CMAKE_CURRENT_BINARY_DIR}/${docbook}.1 | |
318 | ) | |
319 | endforeach() | |
320 | add_custom_target(DOCBOOK_MANPAGES | |
321 | ALL | |
322 | DEPENDS ${MANPAGES} | |
323 | COMMENT "docbook manpages" | |
324 | ) | |
325 | install(FILES | |
326 | ${MANPAGES} | |
327 | DESTINATION ${GDCM_INSTALL_MAN_DIR}/man1 COMPONENT DebugDevel | |
328 | ) | |
329 | else() | |
330 | message(WARNING "Cannot build man page from docbook (need an XSL processor)") | |
331 | endif() | |
332 | 332 | endif() # GDCM_BUILD_DOCBOOK_MANPAGES |
96 | 96 | - cmd: SET PATH=%PATH%;C:\Program Files (x86)\NSIS |
97 | 97 | |
98 | 98 | on_failure: |
99 | - ctest -D ExperimentalSubmit -C %CONFIG% -Q | |
99 | 100 | # Display error log file if generated |
100 | 101 | - dir C:\projects\gdcm\bin |
101 | 102 | - dir C:\projects\gdcm\bin\Release |
103 | 104 | |
104 | 105 | # scripts to run before build |
105 | 106 | before_build: |
106 | - cmake -Wno-dev -G"%VS_GEN%" -DCMAKE_BUILD_TYPE=%CONFIG% -DGDCM_BUILD_TESTING:BOOL=ON -DGDCM_BUILD_APPLICATIONS:BOOL=ON -DGDCM_BUILD_EXAMPLES:BOOL=ON -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DBUILDNAME:STRING=%COMPUTERNAME%-%APPVEYOR_REPO_BRANCH%-%B_NAME% -DGDCM_WRAP_CSHARP:BOOL=ON -DGDCM_WRAP_JAVA:BOOL=ON -DGDCM_WRAP_PYTHON:BOOL=ON -DGDCM_USE_PVRG:BOOL=ON -DGDCM_LEGACY_SILENT:BOOL=ON -DCPACK_SYSTEM_NAME:STRING=%B_NAME% . | |
107 | - cmake -Wno-dev -G"%VS_GEN%" -DCMAKE_BUILD_TYPE=%CONFIG% -DGDCM_BUILD_DOCBOOK_MANPAGES:BOOL=OFF -DGDCM_BUILD_TESTING:BOOL=ON -DGDCM_BUILD_APPLICATIONS:BOOL=ON -DGDCM_BUILD_EXAMPLES:BOOL=ON -DGDCM_BUILD_SHARED_LIBS:BOOL=ON -DBUILDNAME:STRING=%COMPUTERNAME%-%APPVEYOR_REPO_BRANCH%-%B_NAME% -DGDCM_WRAP_CSHARP:BOOL=ON -DGDCM_WRAP_JAVA:BOOL=ON -DGDCM_WRAP_PYTHON:BOOL=ON -DGDCM_USE_PVRG:BOOL=ON -DGDCM_LEGACY_SILENT:BOOL=ON -DCPACK_SYSTEM_NAME:STRING=%B_NAME% . | |
107 | 108 | - ctest -D ExperimentalStart -C %CONFIG% |
108 | 109 | |
109 | 110 | # scripts to run after build |