import slicer
# self.parent.dependencies = ["Segmentations"]
print(f'{dir(slicer.modules)=}')
segLg = slicer.modules.segmentations.logic()
dir(slicer.modules)=['AddManyMarkupsFiducialTestInstance', 'AtlasTestsInstance', 'BRAINSFitRigidRegistrationCrashIssue4139Instance', 'ColorLegendSelfTestInstance', 'CompareVolumesInstance', 'CropVolumeSelfTestInstance', 'CropVolumeSequenceInstance', 'DICOMEnhancedUSVolumePluginInstance', 'DICOMGeAbusPluginInstance', 'DICOMImageSequencePluginInstance', 'DICOMInstance', 'DICOMPatcherInstance', 'DICOMScalarVolumePluginInstance', 'DICOMSlicerDataBundlePluginInstance', 'DICOMVolumeSequencePluginInstance', 'DataProbeInstance', 'EndoscopyInstance', 'ExtensionWizardInstance', 'FiducialLayoutSwitchBug1914Instance', 'ImportItkSnapLabelInstance', 'JRC2013VisInstance', 'JupyterNotebooksInstance', 'LandmarkRegistrationInstance', 'MarkupsInCompareViewersSelfTestInstance', 'MarkupsInViewsSelfTestInstance', 'MultiVolumeImporterInstance', 'MultiVolumeImporterPluginInstance', 'NeurosurgicalPlanningTutorialMarkupsSelfTestInstance', 'PedicleScrewPlannerInstance', 'PedicleScrewSimulatorInstance', 'PedicleTrianglePlannerInstance', 'PerformanceTestsInstance', 'PlotsSelfTestInstance', 'PluggableMarkupsSelfTestInstance', 'PyTorchUtilsInstance', 'RSNA2012ProstateDemoInstance', 'RSNAQuantTutorialInstance', 'RSNAVisTutorialInstance', 'SampleDataInstance', 'ScenePerformanceInstance', 'ScreenCaptureInstance', 'SegmentEditorInstance', 'SegmentStatisticsInstance', 'SelfTestsInstance', 'SequencesSelfTestInstance', 'ShaderPropertiesInstance', 'SimpleFiltersInstance', 'SliceLinkLogicInstance', 'Slicer4MinuteInstance', 'SlicerBoundsTestInstance', 'SlicerDisplayNodeSequenceTestInstance', 'SlicerMRBMultipleSaveRestoreLoopTestInstance', 'SlicerMRBMultipleSaveRestoreTestInstance', 'SlicerMRBSaveRestoreCheckPathsTestInstance', 'SlicerNNUNetInstance', 'SlicerOrientationSelectorTestInstance', 'SlicerPythonTestRunnerInstance', 'SlicerScriptedFileReaderWriterTestInstance', 'SubjectHierarchyCorePluginsSelfTestInstance', 'SubjectHierarchyGenericSelfTestInstance', 'SurfaceToolboxInstance', 'TablesSelfTestInstance', 'TotalSegmentatorInstance', 'UtilTestInstance', 'VectorToScalarVolumeInstance', 'ViewControllersSliceInterpolationBug1926Instance', 'VolumeRenderingSceneCloseInstance', 'WebEngineInstance', 'WebServerInstance', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'dicomPlugins', 'registrationPlugins', 'sampleDataSources', 'sceneImport2428Instance']
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Applications/Slicer.app/Contents/lib/Python/lib/python3.9/imp.py", line 169, in load_source
module = _exec(spec, sys.modules[name])
File "<frozen importlib._bootstrap>", line 613, in _exec
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/liguimei/Documents/ppPrj/Resources/docs/segLg.py", line 4, in <module>
segLg = slicer.modules.segmentations.logic()
AttributeError: module 'modules' has no attribute 'segmentations'
[Qt] loadSourceAsModule - Failed to load file "/Users/liguimei/Documents/ppPrj/Resources/docs/segLg.py" as module "segLg" !
[Qt] Fail to instantiate module "segLg"
Still don’t understand…