7 #include "fwTest/generator/SeriesDB.hpp" 8 #include "fwTest/generator/Image.hpp" 9 #include "fwTest/generator/Mesh.hpp" 11 #include <fwTools/Type.hpp> 13 #include <fwData/Composite.hpp> 14 #include <fwData/Image.hpp> 15 #include <fwData/Material.hpp> 16 #include <fwData/Mesh.hpp> 17 #include <fwData/Reconstruction.hpp> 18 #include <fwData/String.hpp> 20 #include <fwMedData/SeriesDB.hpp> 21 #include <fwMedData/Series.hpp> 22 #include <fwMedData/ImageSeries.hpp> 23 #include <fwMedData/ModelSeries.hpp> 24 #include <fwMedData/ActivitySeries.hpp> 25 #include <fwMedData/Study.hpp> 26 #include <fwMedData/Patient.hpp> 27 #include <fwMedData/Equipment.hpp> 40 const unsigned char nbModelSeries,
41 const unsigned char nbActivitySeries)
44 ::fwMedData::SeriesDB::sptr seriesDB = ::fwMedData::SeriesDB::New();
45 for (
unsigned char nb = 0; nb<nbImgSeries; ++nb)
47 ::fwMedData::Series::sptr imgSeries;
49 seriesDB->getContainer().push_back(imgSeries);
52 for (
unsigned char nb = 0; nb<nbModelSeries; ++nb)
54 ::fwMedData::Series::sptr modelSeries;
56 seriesDB->getContainer().push_back(modelSeries);
59 for (
unsigned char nb = 0; nb<nbActivitySeries; ++nb)
61 ::fwMedData::Series::sptr activitySeries;
63 seriesDB->getContainer().push_back(activitySeries);
72 ::fwMedData::Patient::sptr patient = ::fwMedData::Patient::New();
73 const std::string PATIENT_NAME =
"NomSeriesDB1";
74 const std::string PATIENT_FIRSTNAME =
"PrenomSeriesDB1";
75 const std::string PATIENT_ID =
"4564383757";
76 const std::string PATIENT_BIRTHDATE =
"19710418";
77 const std::string PATIENT_SEX =
"O ";
79 patient->setName( PATIENT_NAME +
"^" + PATIENT_FIRSTNAME );
80 patient->setPatientId( PATIENT_ID );
81 patient->setBirthdate( PATIENT_BIRTHDATE );
82 patient->setSex( PATIENT_SEX );
91 ::fwMedData::Study::sptr study = ::fwMedData::Study::New();
93 static unsigned int count = 1;
94 std::stringstream str;
100 const std::string UID =
"1.2.826.0.1.3680043.2.1125.44278200849347599055201494082232" + str.str();
101 const std::string DATE =
"20130418";
102 const std::string TIME =
"095948.689872 ";
103 const std::string PHYSICIAN =
"Dr^Jekyl";
104 const std::string DESCRIPTION =
"Say 33. ";
105 const std::string PATIENT_AGE =
"042Y";
107 study->setInstanceUID( UID );
108 study->setDate( DATE );
109 study->setTime( TIME );
110 study->setReferringPhysicianName( PHYSICIAN );
111 study->setDescription( DESCRIPTION );
112 study->setPatientAge( PATIENT_AGE );
121 ::fwMedData::Equipment::sptr equipment = ::fwMedData::Equipment::New();
122 const std::string INSTITUTION =
"hospital";
123 equipment->setInstitutionName(INSTITUTION);
137 static unsigned int count = 1;
138 std::stringstream str;
143 const std::string UID =
"1.2.826.0.1.3680043.2.1125.102906542887009256605006409108689" + str.str();
144 const std::string MODALITY =
"CT";
145 const std::string DATE =
"20130418";
146 const std::string TIME =
"101010.101010 ";
147 const std::string DESCRIPTION =
"Description ";
149 ::fwMedData::DicomValuesType performingPhysiciansName;
150 performingPhysiciansName.push_back(
"Dr^Jekyl");
151 performingPhysiciansName.push_back(
"Dr^House");
152 performingPhysiciansName.push_back(
"Dr^Einstein ");
153 series->setPerformingPhysiciansName(performingPhysiciansName);
155 series->setInstanceUID(UID);
156 series->setModality(MODALITY);
157 series->setDate(DATE);
158 series->setTime(TIME);
159 series->setDescription(DESCRIPTION);
166 ::fwMedData::ImageSeries::sptr imgSeries = ::fwMedData::ImageSeries::New();
170 ::fwData::Image::sptr image = ::fwData::Image::New();
173 imgSeries->setImage(image);
182 ::fwMedData::ModelSeries::sptr modelSeries = ::fwMedData::ModelSeries::New();
186 ::fwMedData::ModelSeries::ReconstructionVectorType recDB;
187 for (
unsigned char nb = 0; nb<nbReconstruction; ++nb)
189 ::fwData::Reconstruction::sptr rec = ::fwData::Reconstruction::New();
193 recDB.push_back(rec);
195 modelSeries->setReconstructionDB(recDB);
204 ::fwMedData::ActivitySeries::sptr activitySeries = ::fwMedData::ActivitySeries::New();
208 const std::string CONFIG_ID =
"IdOfTheConfig";
209 activitySeries->setActivityConfigId(CONFIG_ID);
211 ::fwData::Composite::sptr data = ::fwData::Composite::New();
212 data->getContainer()[
"key1"] = ::fwData::String::New(
"ValueOfKey1");
213 activitySeries->setData(data);
215 return activitySeries;
222 rec->setIsVisible(
true);
223 rec->setOrganName(
"liver");
224 rec->setStructureType(
"Liver");
226 ::fwData::Image::sptr img = ::fwData::Image::New();
230 ::fwData::Material::sptr material = ::fwData::Material::New();
231 material->ambient()->red() = 0.75f;
232 material->ambient()->green() = 0.10f;
233 material->ambient()->blue() = 0.56f;
234 material->ambient()->alpha() = 0.8f;
235 material->diffuse()->red() = 0.85f;
236 material->diffuse()->green() = 0.20f;
237 material->diffuse()->blue() = 0.66f;
238 material->diffuse()->alpha() = 0.9f;
239 rec->setMaterial(material);
241 ::fwData::Mesh::sptr mesh = ::fwData::Mesh::New();
static FWTEST_API std::shared_ptr< ::fwMedData::Study > createStudy()
Returns a Study with dummy informations.
static FWTEST_API std::shared_ptr< ::fwMedData::ImageSeries > createImageSeries()
Returns an ImageSeries with a randomized image.
static FWTEST_API void generateRandomImage(::fwData::Image::sptr image,::fwTools::Type type)
Generate an image with random information (size, spacing, ...). Buffer is filled with random values...
static FWTEST_API void initRand()
Initialize 'rand' seed.
static FWTEST_API std::shared_ptr< ::fwMedData::ModelSeries > createModelSeries(unsigned char nbReconstruction)
Returns a ModelSeries containing random Reconstructions.
static FWTEST_API std::shared_ptr< ::fwMedData::Patient > createPatient()
Returns a Patient with dummy informations.
static FWTEST_API void generateSeriesInformation(std::shared_ptr< ::fwMedData::Series > series)
Generates dummy informations for the series.
static FWTEST_API std::shared_ptr< ::fwMedData::SeriesDB > createSeriesDB(const unsigned char nbImgSeries, const unsigned char nbModelSeries, const unsigned char nbActivitySeries)
Creates a SeriesDB.
static FWTEST_API void generateReconstruction(std::shared_ptr< ::fwData::Reconstruction > rec)
Generate a reconstruction.
static FWTEST_API std::shared_ptr< ::fwMedData::ActivitySeries > createActivitySeries()
Returns an ActivitySeries with dummy data.
static FWTEST_API void generateMesh(::fwData::Mesh::sptr mesh)
Generate a mesh.
static FWTEST_API std::shared_ptr< ::fwMedData::Equipment > createEquipement()
Returns an Equipment with dummy informations.