Ejemplo n.º 1
0
    def _showVolumeColorSlices(self, param=None):
        imageFile = self.protocol._getFileName(RESMAP_VOL)
        imgData, _, _, _ = self.getImgData(imageFile)

        xplotter = EmPlotter(x=2,
                             y=2,
                             mainTitle="Local Resolution Slices "
                             "along %s-axis." % self._getAxis())
        # The slices to be shown are close to the center. Volume size is divided
        # in segments, the fourth central ones are selected i.e. 3,4,5,6
        for i in list(range(3, 7)):
            sliceNumber = self.getSlice(i, imgData)
            a = xplotter.createSubPlot("Slice %s" % (sliceNumber + 1), '', '')
            matrix = self.getSliceImage(imgData, sliceNumber, self._getAxis())
            plot = xplotter.plotMatrix(a,
                                       matrix,
                                       self.lowest.get(),
                                       self.highest.get(),
                                       cmap=self.getColorMap(),
                                       interpolation="nearest")
        xplotter.getColorBar(plot)
        return [xplotter]
Ejemplo n.º 2
0
 def _showOneColorslice(self, param=None):
     imageFile = self.protocol._getFileName(RESMAP_VOL)
     imgData, _, _, volDims = self.getImgData(imageFile)
     print(volDims)
     xplotter = EmPlotter(x=1,
                          y=1,
                          mainTitle="Local Resolution Slices "
                          "along %s-axis." % self._getAxis())
     sliceNumber = self.sliceNumber.get()
     if sliceNumber < 0:
         sliceNumber = volDims[0] / 2
     else:
         sliceNumber -= 1
     # sliceNumber has no sense to start in zero
     a = xplotter.createSubPlot("Slice %s" % (sliceNumber + 1), '', '')
     matrix = self.getSliceImage(imgData, sliceNumber, self._getAxis())
     plot = xplotter.plotMatrix(a,
                                matrix,
                                self.lowest.get(),
                                self.highest.get(),
                                cmap=self.getColorMap(),
                                interpolation="nearest")
     xplotter.getColorBar(plot)
     return [xplotter]