31 vec.push_back( value );
35 for (
int k = 0; k < n ; k++)
44 vec.push_back( value );
66 m_GdcmIO->LoadPrivateTagsOn();
67 m_GdcmIO->SetMaxSizeLoadEntry( 65536 );
70 m_VolumeReader->SetImageIO( m_GdcmIO );
71 m_VolumeReader->SetFileNames( m_DicomFilenames );
75 m_VolumeReader->Update();
77 catch (itk::ExceptionObject &excp)
79 std::cerr <<
"Exception thrown while reading slice" << std::endl;
80 std::cerr << excp << std::endl;
81 return SV_UNKNOWN_VENDOR;
84 VolumeReaderType::DictionaryArrayRawPointer inputDict
85 = m_VolumeReader->GetMetaDataDictionaryArray();
88 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0008|0070", vendor );
92 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0008|0008",
ImageType );
95 if ( vendor.find(
"GE") != std::string::npos )
100 else if( vendor.find(
"SIEMENS") != std::string::npos )
102 if ( ImageType.find(
"MOSAIC") != std::string::npos )
105 return SV_SIEMENS_MOSAIC;
113 else if( vendor.find(
"PHILIPS") != std::string::npos )
121 return SV_UNKNOWN_VENDOR;
130 if(m_DicomFilenames.size())
134 m_Output->m_DicomFilenames = m_DicomFilenames;
137 switch(GetVendorID())
143 reader->SetSeriesDicomFilenames(this->m_DicomFilenames);
144 reader->SetGdcmIO(this->m_GdcmIO);
145 reader->SetVolumeReader(this->m_VolumeReader);
146 reader->SetOutputPointer(this->m_Output);
148 this->m_Output = reader->GetOutput();
155 reader->SetSeriesDicomFilenames(this->m_DicomFilenames);
156 reader->SetGdcmIO(this->m_GdcmIO);
157 reader->SetVolumeReader(this->m_VolumeReader);
158 reader->SetOutputPointer(this->m_Output);
160 this->m_Output = reader->GetOutput();
163 case(SV_SIEMENS_MOSAIC):
168 reader->SetSeriesDicomFilenames(this->m_DicomFilenames);
169 reader->SetGdcmIO(this->m_GdcmIO);
170 reader->SetVolumeReader(this->m_VolumeReader);
171 reader->SetOutputPointer(this->m_Output);
173 this->m_Output = reader->GetOutput();
181 reader->SetSeriesDicomFilenames(this->m_DicomFilenames);
182 reader->SetGdcmIO(this->m_GdcmIO);
183 reader->SetVolumeReader(this->m_VolumeReader);
184 reader->SetOutputPointer(this->m_Output);
186 this->m_Output = reader->GetOutput();
189 case(SV_UNKNOWN_VENDOR):
191 std::cerr <<
"diffusion header reader: unknown vendor" << std::endl;
209 VolumeReaderType::DictionaryArrayRawPointer inputDict
210 = m_VolumeReader->GetMetaDataDictionaryArray();
213 m_nSlice = inputDict->size();
217 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0008|103e", tag );
218 this->m_Output->seriesDescription = tag.c_str();
221 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0020|0011", tag );
222 this->m_Output->seriesNumber = atoi(tag.c_str());
225 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0010|0010", tag );
226 this->m_Output->patientName = tag.c_str();
229 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0028|0010", tag );
230 this->m_Output->nRows = atoi( tag.c_str() );
233 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0028|0011", tag );
234 this->m_Output->nCols = atoi( tag.c_str() );
237 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0028|0030", tag );
238 sscanf( tag.c_str(),
"%f\\%f", &this->m_Output->xRes, &this->m_Output->yRes );
241 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0020|0032", tag );
242 sscanf( tag.c_str(),
"%f\\%f\\%f", &this->m_Output->xOrigin, &this->m_Output->yOrigin, &this->m_Output->zOrigin );
245 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0018|0050", tag );
246 this->m_Output->sliceThickness = atof( tag.c_str() );
249 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0018|0088", tag );
250 this->m_Output->sliceSpacing = atof( tag.c_str() );
254 for (
int k = 0; k < m_nSlice; k++)
257 itk::ExposeMetaData<std::string> ( *(*inputDict)[k],
"0020|1041", tag);
258 float sliceLocation = atof( tag.c_str() );
267 itk::ExposeMetaData<std::string> ( *(*inputDict)[0],
"0020|0037", tag );
268 float xRow, yRow, zRow, xCol, yCol, zCol, xSlice, ySlice, zSlice ;
269 sscanf( tag.c_str(),
"%f\\%f\\%f\\%f\\%f\\%f", &xRow, &yRow, &zRow, &xCol, &yCol, &zCol );
284 xSlice = (yRow*zCol-zRow*yCol)*this->m_Output->sliceSpacing;
285 ySlice = (zRow*xCol-xRow*zCol)*this->m_Output->sliceSpacing;
286 zSlice = (xRow*yCol-yRow*xCol)*this->m_Output->sliceSpacing;
288 xRow *= this->m_Output->xRes;
289 yRow *= this->m_Output->xRes;
290 zRow *= this->m_Output->xRes;
292 xCol *= this->m_Output->yRes;
293 yCol *= this->m_Output->yRes;
294 zCol *= this->m_Output->yRes;
296 this->m_Output->xRow = xRow;
297 this->m_Output->yRow = yRow;
298 this->m_Output->zRow = zRow;
299 this->m_Output->xCol = xCol;
300 this->m_Output->yCol = yCol;
301 this->m_Output->zCol = zCol;
302 this->m_Output->xSlice = xSlice;
303 this->m_Output->ySlice = ySlice;
304 this->m_Output->zSlice = zSlice;
313 this->m_Output->xSlice = -this->m_Output->xSlice;
314 this->m_Output->ySlice = -this->m_Output->ySlice;
315 this->m_Output->zSlice = -this->m_Output->zSlice;
323 if ( !m_SliceOrderIS )
325 this->m_Output->DiffusionVector[2] = -this->m_Output->DiffusionVector[2];
itk::SmartPointer< Self > Pointer
map::core::discrete::Elements< 3 >::InternalImageType ImageType
Convenience class to temporarily change the current locale.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.