Exemplo n.º 1
0
    def _open(self, fileName):
        self.clearLabels()
        self.view.clear()
        loader = Loader()
        d = loader.loadDicom(fileName)
        if loader.isImage():
            self.view = ImageView()
        elif loader.isVolume():
            self.view = DicomView()
        elif loader.isVideo():
            self.view = VideoView()

        self.initViewSlot()
        self.setCentralWidget(self.view)
        self.view.addMenu(self.actions.editMenu)

        self.view.loadImage(d)
        self.zoom_widget.setValue(100)
        self.actions.saveAs.setEnabled(False)
        self.toggleDrawMode(type.Mode_polygon)
        self.loader = loader
Exemplo n.º 2
0
                x = idx * self._spacing[0]
            elif st is type.SLICE_Y:
                y = idx * self._spacing[1]
            elif st is type.SLICE_Z:
                z = idx * self._spacing[2]

            self._resliceMatrix.SetElement(0, 3, x)
            self._resliceMatrix.SetElement(1, 3, y)
            self._resliceMatrix.SetElement(2, 3, z)
            self._reslice.SetResliceAxes(self._resliceMatrix)
            self._reslice.SetInputData(out_data)
            self._reslice.Update()
            out_data = self._reslice.GetOutput()
            self.sliceIndex = idx

        out_data = self.conv2qimg(out_data)

        return out_data

    def getQImage(self):
        return self.qimage


if __name__ == "__main__":

    loader = Loader()
    d = loader.loadDicom(r"F:\github\labeldicom_cpp\testData\5_a.png")

    wapper = ImageDataWapper(d)
    wapper.getQImage()