Exemplo n.º 1
0
void SeriesDB::generateReconstruction(::fwData::Reconstruction::sptr rec)
{
    rec->setIsVisible(true);
    rec->setOrganName("liver");
    rec->setStructureType("Liver");

    ::fwData::Image::sptr img = ::fwData::Image::New();
    Image::generateRandomImage(img, ::fwTools::Type::create("uint16"));
    rec->setImage(img);

    ::fwData::Material::sptr material = ::fwData::Material::New();
    material->ambient()->red() = 0.75f;
    material->ambient()->green() = 0.10f;
    material->ambient()->blue() = 0.56f;
    material->ambient()->alpha() = 0.8f;
    material->diffuse()->red() = 0.85f;
    material->diffuse()->green() = 0.20f;
    material->diffuse()->blue() = 0.66f;
    material->diffuse()->alpha() = 0.9f;
    rec->setMaterial(material);

    ::fwData::Mesh::sptr mesh = ::fwData::Mesh::New();
    Mesh::generateMesh( mesh );

    rec->setMesh(mesh);
}
Exemplo n.º 2
0
void DicomSegmentReader::readSurfaceSegmentation( ::fwData::Reconstruction::sptr            a_reconstruction,
                                                  ::gdcm::SmartPointer< ::gdcm::Segment >   a_segment ) throw (::fwTools::Failed)
{
    if (a_segment->GetSurfaceCount() != 1)
        throw ::fwTools::Failed("Unappropriated surface count for a segment");

    //*****     Set the reconstruction      *****//
    // Organ Name
    // TODO : if empty, try to get label with DicomDictionarySegment
    a_reconstruction->setOrganName( a_segment->GetSegmentDescription());
    OSLM_TRACE("Organ Name : " << a_reconstruction->getOrganName());

    a_reconstruction->setStructureType(a_segment->GetSegmentLabel());
    OSLM_TRACE("Structure type : " << a_reconstruction->getStructureType());

    a_reconstruction->setIsAutomatic( ((a_segment->GetSegmentAlgorithmType() == ::gdcm::Segment::AUTOMATIC)? true : false) );
    OSLM_TRACE("Reconstruction is automatic : " << a_reconstruction->getIsAutomatic());
}