Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Simplify setup of ShapeVariationAnalyzerWidget #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Apr 29, 2022

This commit removes the explicit setting of ivars and instead uses
the function slicer.util.childWidgetVariables.

The updates was done following these steps:

  1. Systematic replace of self.<widgetName> with self.ui.<widgetName>
script=ShapeVariationAnalyzer/ShapeVariationAnalyzer.py
for widget in $(cat $script | ack "getUI\('" | cut -d"'" -f2); do
  sed "s/self\.$widget/self.ui.$widget/" $script -i;
done
  1. Manual removal of lines including self.getUI and removal of implementation of getUI function.

  2. Additional replacements in script:

self.spinBox_colorModeParam1
-> self.ui.spinBox_colorModeParam_1

self.spinBox_colorModeParam2
-> self.ui.spinBox_colorModeParam_2

self.checkableComboBox_ChoiceOfGroup
-> self.ui.checkableComboBox_ChoiceOfGroup

self.collapsibleButton_creationCSVFile
-> self.ui.collapsibleButton_creationCSVFile

self.collapsibleButton_previewClassificationGroups
-> self.ui.collapsibleButton_previewClassificationGroups

self.collapsibleGroupBox_previewVTKFiles
-> self.ui.collapsibleGroupBox_previewVTKFiles
  1. Additional replacements in UI file

This commit removes the explicit setting of ivars and instead uses
the function `slicer.util.childWidgetVariables`.

The updates was done following these steps:

(1) Systematic replace of "self.<widgetName>" with "self.ui.<widgetName>"

  script=ShapeVariationAnalyzer/ShapeVariationAnalyzer.py
  for widget in $(cat $script | ack "getUI\('" | cut -d"'" -f2); do
    sed "s/self\.$widget/self.ui.$widget/" $script -i;
  done

(2) Manual removal of lines including "self.getUI" and removal of
    implementation of "getUI" function.

(3) Additional replacements in script:

  self.spinBox_colorModeParam1
  -> self.ui.spinBox_colorModeParam_1

  self.spinBox_colorModeParam2
  -> self.ui.spinBox_colorModeParam_2

  self.checkableComboBox_ChoiceOfGroup
  -> self.ui.checkableComboBox_ChoiceOfGroup

  self.collapsibleButton_creationCSVFile
  -> self.ui.collapsibleButton_creationCSVFile

  self.collapsibleButton_previewClassificationGroups
  -> self.ui.collapsibleButton_previewClassificationGroups

  self.collapsibleGroupBox_previewVTKFiles
  -> self.ui.collapsibleGroupBox_previewVTKFiles

(4) Additional replacements in UI file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant