Bug Report ISO ASO Extension – Missing testWslAvailable and helper methods cause crash

Hi everyone,

I ran into an issue trying to use the ISO ASO extension (Automated Dental Tools) in 3D Slicer 5.8.1 on Windows 11 with WSL2 + Ubuntu 24.04.

Problem

When launching ISO ASO and clicking Run, the module gets stuck at “Checking if WSL is installed, this task may take a moment”. In the Slicer log, I see this error:

Traceback (most recent call last):
  File ".../ASO.py", line 1506, in onCheckRequirements
    if self.logic.testWslAvailable():
AttributeError: 'ASOLogic' object has no attribute 'testWslAvailable'

Later, even after adding that function to ASO.py, I hit:

AttributeError: 'ASOWidget' object has no attribute 'format_time'

Cause

The current extension code is calling functions that don’t exist in ASOLogic and ASOWidget:

  • ASOLogic.testWslAvailable()

  • ASOWidget.format_time()

  • ASOWidget.update_ui_time()

Without these, the requirements check crashes and the module never gets to create the conda environment.

Workaround / Fix

I was able to fix it by adding these functions back into the extension:

Inside ASOLogic (ASO.py):

def testWslAvailable(self) -> bool:
    if platform.system() != "Windows":
        return False
    try:
        result = subprocess.run(
            ["wsl", "--status"],
            capture_output=True,
            text=True,
            timeout=5
        )
        return result.returncode == 0
    except Exception:
        return False

Inside ASOWidget (ASO.py):

def format_time(self, seconds: float) -> str:
    if seconds < 60:
        return f"{int(seconds)}s"
    elif seconds < 3600:
        return f"{int(seconds // 60)}min {int(seconds % 60)}s"
    else:
        return f"{int(seconds // 3600)}h {int((seconds % 3600) // 60)}min {int(seconds % 60)}s"

def update_ui_time(self, start_time: float, previous_time: float) -> str:
    current_time = time.time()
    elapsed = current_time - start_time
    return self.format_time(elapsed)

Result

With these added, the ISO ASO extension now correctly:

  • Detects WSL2

  • Detects Miniconda

  • Creates the conda environment in WSL

  • Moves on to library installation

Hope this helps others who get stuck at the same point!

Fabien