当前位置: 首页>>代码示例>>C++>>正文


C++ Series::addImage方法代码示例

本文整理汇总了C++中Series::addImage方法的典型用法代码示例。如果您正苦于以下问题:C++ Series::addImage方法的具体用法?C++ Series::addImage怎么用?C++ Series::addImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Series的用法示例。


在下文中一共展示了Series::addImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: build


//.........这里部分代码省略.........
        case VTK_SIGNED_CHAR:
            bitsAllocated = 8;
            pixelRepresentation = 1;
            break;
        case VTK_UNSIGNED_CHAR:
            bitsAllocated = 8;
            pixelRepresentation = 0;
            break;
        case VTK_SHORT:
            bitsAllocated = 16;
            pixelRepresentation = 1;
            break;
        case VTK_UNSIGNED_SHORT:
            bitsAllocated = 16;
            pixelRepresentation = 0;
            break;
        case VTK_INT:
            bitsAllocated = 32;
            pixelRepresentation = 1;
            break;
        case VTK_UNSIGNED_INT:
            bitsAllocated = 32;
            pixelRepresentation = 0;
            break;
//        case VTK_FLOAT:
//            bitsAllocated = 32;
//            pixelRepresentation = 1; ?
//            break;
//        case VTK_DOUBLE:
//            bitsAllocated = 64;
//            pixelRepresentation = 1; ?
//            break;
        default:
            DEBUG_LOG(QString("Pixel Type no suportat: ") + newVtkData->GetScalarTypeAsString());

    }

    bitsStored = bitsAllocated;
    highBit = bitsStored - 1;

    int *dimensions = newVtkData->GetDimensions();
    double *spacing = newVtkData->GetSpacing();

    rows = dimensions[1];
    columns = dimensions[0];

    Image *currentImage;

    for (int i = 0; i < dimensions[2]; i++)
    {
        currentImage = new Image();

        // Generem el SOPInstanceUID a partir del generador de DCMTK. \TODO Utilitzar el nostre UID_ROOT?
        char instanceUid[100];
        dcmGenerateUniqueIdentifier(instanceUid, SITE_INSTANCE_UID_ROOT);
        currentImage->setSOPInstanceUID(QString(instanceUid));
        newSeries->addImage(currentImage);
        newVolume->addImage(currentImage);
        currentImage->setParentSeries(newSeries);
        currentImage->setOrderNumberInVolume(i);
        currentImage->setVolumeNumberInSeries(0);

        currentImage->setBitsAllocated(bitsAllocated);
        currentImage->setBitsStored(bitsStored);
        currentImage->setHighBit(highBit);
        currentImage->setColumns(columns);
        currentImage->setInstanceNumber(QString::number(i + 1));
        currentImage->setPhotometricInterpretation(photometricInterpretation);
        currentImage->setPixelRepresentation(pixelRepresentation);
        currentImage->setPixelSpacing(spacing[0], spacing[1]);
        currentImage->setRows(rows);
        currentImage->setSamplesPerPixel(samplesPerPixel);

    }

    // Es fa després d'haver inserit les imatges perquè el nou Volume activi el flag de dades carregades.
    newVolume->setData(newVtkData);

    newVolume->setNumberOfPhases(1);
    newVolume->setNumberOfSlicesPerPhase(newSeries->getImages().count());

    // Informació de DEBUG
    DEBUG_LOG(QString("\nNova sèrie generada:") +
     QString("\n  SeriesInstanceUID: ") + newSeries->getInstanceUID() +
     QString("\n  SeriesNumber: ") + newSeries->getSeriesNumber() +
     QString("\n  SeriesDescription: ") + newSeries->getDescription() +
     QString("\n  SOPClassUID: ") + newSeries->getSOPClassUID() +
     QString("\n  Modality: ") + newSeries->getModality() +
     QString("\n  SamplesPerPixel: ") + QString::number(samplesPerPixel) +
     QString("\n  PhotometricInterpretation: ") + photometricInterpretation +
     QString("\n  BitsAllocated: ") + QString::number(bitsAllocated) +
     QString("\n  BitsStored: ") + QString::number(bitsStored) +
     QString("\n  HighBit: ") + QString::number(highBit) +
     QString("\n  PixelRepresentation: ") + QString::number(pixelRepresentation) +
     QString("\n  PixelSpacing: ") + QString::number(spacing[0]) + QString(",") + QString::number(spacing[1]) +
     QString("\n  Num.Imatges: ") + QString::number(newSeries->getImages().count()));

    return newVolume;

}
开发者ID:chinhtrandn,项目名称:starviewer,代码行数:101,代码来源:volumebuilderfromcaptures.cpp


注:本文中的Series::addImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。