Пример #1
0
    def _handlerTransformButton(self, event):
        # take xtranslate, ytranslate, rotate and work it into the current
        # transform (if that exists)
        if self._pairNumber > 0:
            pda = self._transformStack[self._pairNumber].GetParameters()

            rot = gen_utils.textToFloat(
                self.controlFrame.rotationTextCtrl.GetValue(),
                pda.GetElement(0))
            xt = gen_utils.textToFloat(
                self.controlFrame.xTranslationTextCtrl.GetValue(),
                pda.GetElement(1))
            yt = gen_utils.textToFloat(
                self.controlFrame.yTranslationTextCtrl.GetValue(),
                pda.GetElement(2))

            pda.SetElement(0, rot)
            pda.SetElement(1, xt)
            pda.SetElement(2, yt)

            self._transformStack[self._pairNumber].SetParameters(pda)
            # we have to do this manually
            self._transformStack[self._pairNumber].Modified()

            self._rescaler2.Update()  # give ITK a chance to complain
            self.viewerFrame.threedRWI.GetRenderWindow().Render()
Пример #2
0
    def _handlerTransformButton(self, event):
        # take xtranslate, ytranslate, rotate and work it into the current
        # transform (if that exists)
        if self._pairNumber > 0:
            pda = self._transformStack[self._pairNumber].GetParameters()
            
            rot = gen_utils.textToFloat(
                self.controlFrame.rotationTextCtrl.GetValue(),
                pda.GetElement(0))
            xt = gen_utils.textToFloat(
                self.controlFrame.xTranslationTextCtrl.GetValue(),
                pda.GetElement(1))
            yt = gen_utils.textToFloat(
                self.controlFrame.yTranslationTextCtrl.GetValue(),
                pda.GetElement(2))

            pda.SetElement(0, rot)
            pda.SetElement(1, xt)
            pda.SetElement(2, yt)

            self._transformStack[self._pairNumber].SetParameters(pda)
            # we have to do this manually
            self._transformStack[self._pairNumber].Modified()

            self._rescaler2.Update() # give ITK a chance to complain
            self.viewerFrame.threedRWI.GetRenderWindow().Render()
Пример #3
0
    def view_to_config(self):
        self._config.numberOfBins = gen_utils.textToInt(
            self._viewFrame.numBinsSpinCtrl.GetValue(), self._config.numberOfBins
        )

        self._config.minValue = gen_utils.textToFloat(self._viewFrame.minValueText.GetValue(), self._config.minValue)

        self._config.maxValue = gen_utils.textToFloat(self._viewFrame.maxValueText.GetValue(), self._config.maxValue)

        if self._config.minValue > self._config.maxValue:
            self._config.maxValue = self._config.minValue
Пример #4
0
    def view_to_config(self):
        self._config.numberOfBins = gen_utils.textToInt(
            self._viewFrame.numBinsSpinCtrl.GetValue(),
            self._config.numberOfBins)

        self._config.minValue = gen_utils.textToFloat(
            self._viewFrame.minValueText.GetValue(), self._config.minValue)

        self._config.maxValue = gen_utils.textToFloat(
            self._viewFrame.maxValueText.GetValue(), self._config.maxValue)

        if self._config.minValue > self._config.maxValue:
            self._config.maxValue = self._config.minValue
Пример #5
0
    def _handlerRegisterButton(self, event):
        maxIterations = gen_utils.textToFloat(
            self.controlFrame.maxIterationsTextCtrl.GetValue(), 50)
        if not maxIterations > 0:
            maxIterations = 50

        self._registerCurrentPair(maxIterations)

        self.controlFrame.maxIterationsTextCtrl.SetValue(str(maxIterations))
Пример #6
0
 def _handlerRegisterButton(self, event):
     maxIterations = gen_utils.textToFloat(
         self.controlFrame.maxIterationsTextCtrl.GetValue(), 50)
     if not maxIterations > 0:
         maxIterations = 50
         
     self._registerCurrentPair(maxIterations)
     
     self.controlFrame.maxIterationsTextCtrl.SetValue(str(maxIterations))
Пример #7
0
    def view_to_config(self):
        itc = self._view_frame.interpolationTypeChoice.GetSelection()
        if itc < 0 or itc > 2:
            # default when something weird happens to choice
            itc = 1

        self._config.interpolationMode = itc

        txtTup = self._view_frame.magFactorXText.GetValue(), \
                 self._view_frame.magFactorYText.GetValue(), \
                 self._view_frame.magFactorZText.GetValue()

        for i in range(3):
            self._config.magFactors[i] = gen_utils.textToFloat(
                txtTup[i], self._config.magFactors[i])
Пример #8
0
    def view_to_config(self):
        itc = self._view_frame.interpolationTypeChoice.GetSelection()
        if itc < 0 or itc > 2:
            # default when something weird happens to choice
            itc = 1

        self._config.interpolationMode = itc

        txtTup = self._view_frame.magFactorXText.GetValue(), \
                 self._view_frame.magFactorYText.GetValue(), \
                 self._view_frame.magFactorZText.GetValue()

        for i in range(3):
            self._config.magFactors[i] = gen_utils.textToFloat(
                txtTup[i], self._config.magFactors[i])