<commit_before>from __main__ import vtk, qt, ctk, slicer
#
# Scar Visualization
#

class ScarVisualization:
  def __init__(self, parent):
    parent.title = "Scar Visualization"
    parent.categories = ["Cardiac MRI Toolkit"]
    parent.contributors = ["<NAME> (CARMA), <NAME> (CARMA), <NAME> (CARMA), <NAME> (CARMA)"]
    parent.helpText = """This module is used for scar or fibrosis visualization of the left atrium of the heart. It requires three inputs:<br>1.A cardiac LGE-MRI image<br>2.The LA endocardium segmentation<br> 3.The LA wall segmentation.<br><br> The final model can be thresholded as required to display regions of fibrosis or scar.<br><br>More information about this module can be found at <a href=http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ScarVisualization>http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ScarVisualization"""
    parent.acknowledgementText = """ """
    self.parent = parent

class ScarVisualizationWidget:
  def __init__(self, parent=None):
    if not parent:
      self.parent = slicer.qMRMLWidget()
      self.parent.setLayout(qt.QVBoxLayout())
      self.parent.setMRMLScene(slicer.mrmlScene)
    else:
      self.parent = parent
    self.layout = self.parent.layout()
    if not parent:
      self.setup()
      self.parent.show()
	
  def setup(self):		
    # Input/Output collapsible button
    collapsibleButton = ctk.ctkCollapsibleButton()
    collapsibleButton.text = "IO"
    self.layout.addWidget(collapsibleButton)
		
    # Layout within the dummy collapsible button
    formLayout = qt.QFormLayout(collapsibleButton)

    # The input volume selector
    self.inputVolumeFrame = qt.QFrame(collapsibleButton)
    self.inputVolumeFrame.setLayout(qt.QHBoxLayout())
    formLayout.addWidget(self.inputVolumeFrame)
    self.inputVolumeSelector = qt.QLabel("Input Image Volume: ", self.inputVolumeFrame)
    self.inputVolumeFrame.layout().addWidget(self.inputVolumeSelector)
    self.inputVolumeSelector = slicer.qMRMLNodeComboBox(self.inputVolumeFrame)
    self.inputVolumeSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" )
    self.inputVolumeSelector.addEnabled = False
    self.inputVolumeSelector.removeEnabled = True
    self.inputVolumeSelector.renameEnabled = True
    self.inputVolumeSelector.setMRMLScene( slicer.mrmlScene )
    self.inputVolumeFrame.layout().addWidget(self.inputVolumeSelector)
		
    # The endo segmentation selector
    self.endoLabelFrame = qt.QFrame(collapsibleButton)
    self.endoLabelFrame.setLayout(qt.QHBoxLayout())
    formLayout.addWidget(self.endoLabelFrame)
    self.endoLabelSelector = qt.QLabel("Endo Label Map: ", self.endoLabelFrame)
    self.endoLabelFrame.layout().addWidget(self.endoLabelSelector)
    self.endoLabelSelector = slicer.qMRMLNodeComboBox(self.endoLabelFrame)
    self.endoLabelSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" )
    self.endoLabelSelector.addAttribute( "vtkMRMLScalarVolumeNode", "LabelMap", 1 )
    self.endoLabelSelector.addEnabled = False
    self.endoLabelSelector.removeEnabled = True
    self.endoLabelSelector.renameEnabled = True
    self.endoLabelSelector.setMRMLScene( slicer.mrmlScene )
    self.endoLabelFrame.layout().addWidget(self.endoLabelSelector)

    # The wall segmentation selector
    self.wallLabelFrame = qt.QFrame(collapsibleButton)
    self.wallLabelFrame.setLayout(qt.QHBoxLayout())
    formLayout.addWidget(self.wallLabelFrame)
    self.wallLabelSelector = qt.QLabel("Wall Label Map: ", self.wallLabelFrame)
    self.wallLabelFrame.layout().addWidget(self.wallLabelSelector)
    self.wallLabelSelector = slicer.qMRMLNodeComboBox(self.wallLabelFrame)
    self.wallLabelSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" )
    self.wallLabelSelector.addAttribute( "vtkMRMLScalarVolumeNode", "LabelMap", 1 )
    self.wallLabelSelector.addEnabled = False<commit_msg>Use vtkMRMLLabelMapVolumeNode integrated in Slicer r24291<commit_after>from __main__ import vtk, qt, ctk, slicer
#
# Scar Visualization
#

class ScarVisualization:
  def __init__(self, parent):
    parent.title = "Scar Visualization"
    parent.categories = ["Cardiac MRI Toolkit"]
    parent.contributors = ["<NAME> (CARMA), <NAME> (CARMA), <NAME> (CARMA), <NAME> (CARMA)"]
    parent.helpText = """This module is used for scar or fibrosis visualization of the left atrium of the heart. It requires three inputs:<br>1.A cardiac LGE-MRI image<br>2.The LA endocardium segmentation<br> 3.The LA wall segmentation.<br><br> The final model can be thresholded as required to display regions of fibrosis or scar.<br><br>More information about this module can be found at <a href=http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ScarVisualization>http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/ScarVisualization"""
    parent.acknowledgementText = """ """
    self.parent = parent

class ScarVisualizationWidget:
  def __init__(self, parent=None):
    if not parent:
      self.parent = slicer.qMRMLWidget()
      self.parent.setLayout(qt.QVBoxLayout())
      self.parent.setMRMLScene(slicer.mrmlScene)
    else:
      self.parent = parent
    self.layout = self.parent.layout()
    if not parent:
      self.setup()
      self.parent.show()
	
  def setup(self):		
    # Input/Output collapsible button
    collapsibleButton = ctk.ctkCollapsibleButton()
    collapsibleButton.text = "IO"
    self.layout.addWidget(collapsibleButton)
		
    # Layout within the dummy collapsible button
    formLayout = qt.QFormLayout(collapsibleButton)

    # The input volume selector
    self.inputVolumeFrame = qt.QFrame(collapsibleButton)
    self.inputVolumeFrame.setLayout(qt.QHBoxLayout())
    formLayout.addWidget(self.inputVolumeFrame)
    self.inputVolumeSelector = qt.QLabel("Input Image Volume: ", self.inputVolumeFrame)
    self.inputVolumeFrame.layout().addWidget(self.inputVolumeSelector)
    self.inputVolumeSelector = slicer.qMRMLNodeComboBox(self.inputVolumeFrame)
    self.inputVolumeSelector.nodeTypes = ( ("vtkMRMLScalarVolumeNode"), "" )
    self.inputVolumeSelector.addEnabled = False
    self.inputVolumeSelector.removeEnabled = True
    self.inputVolumeSelector.renameEnabled = True
    self.inputVolumeSelector.setMRMLScene( slicer.mrmlScene )
    self.inputVolumeFrame.layout().addWidget(self.inputVolumeSelector)
		
    # The endo segmentation selector
    self.endoLabelFrame = qt.QFrame(collapsibleButton)
    self.endoLabelFrame.setLayout(qt.QHBoxLayout())
    formLayout.addWidget(self.endoLabelFrame)
    self.endoLabelSelector = qt.QLabel("Endo Label Map: ", self.endoLabelFrame)
    self.endoLabelFrame.layout().addWidget(self.endoLabelSelector)
    self.endoLabelSelector = slicer.qMRMLNodeComboBox(self.endoLabelFrame)
    self.endoLabelSelector.nodeTypes = ( ("vtkMRMLLabelMapVolumeNode"), "" )
    self.endoLabelSelector.addEnabled = False
    self.endoLabelSelector.removeEnabled = True
    self.endoLabelSelector.renameEnabled = True
    self.endoLabelSelector.setMRMLScene( slicer.mrmlScene )
    self.endoLabelFrame.layout().addWidget(self.endoLabelSelector)

    # The wall segmentation selector
    self.wallLabelFrame = qt.QFrame(collapsibleButton)
    self.wallLabelFrame.setLayout(qt.QHBoxLayout())
    formLayout.addWidget(self.wallLabelFrame)
    self.wallLabelSelector = qt.QLabel("Wall Label Map: ", self.wallLabelFrame)
    self.wallLabelFrame.layout().addWidget(self.wallLabelSelector)
    self.wallLabelSelector = slicer.qMRMLNodeComboBox(self.wallLabelFrame)
    self.wallLabelSelector.nodeTypes = ( ("vtkMRMLLabelMapVolumeNode"), "" )
    self.wallLabelSelector.addEnabled = False
{'fraction_non_alphanumeric': 0.10332199843055193, 'fraction_numerical': 0.0017002354172116138, 'mean_word_length': 4.689732142857143, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7516317', 'n_tokens_mistral': 2376, 'n_tokens_neox': 2321, 'n_words': 418}