RecipeRecorder

Recipe recording for capturing manual segmentation sessions.

Records user actions and generates Python recipe files.

Classes

class RecordedStroke

A recorded brush stroke.

class RecordedParamChange

A recorded parameter change.

class RecipeRecorder

Record manual Slicer sessions into Python recipe files.

Example:

recorder = RecipeRecorder() recorder.start(“MRBrainTumor1”, “Tumor”)

# … user performs manual segmentation …

recorder.stop() recorder.save(“recipes/my_segmentation.py”)

Methods:

__init__()

Initialize recorder.

start()

Start recording a session.

stop()

Stop recording.

record_stroke()

Record a brush stroke.

record_param_change()

Record a parameter change.

save()

Save recording as a Python recipe file.

is_recording()

Check if currently recording.

Functions

start()

Start recording a session.

Args:

sample_data: Slicer SampleData name. segment_name: Name of the segment being created.

stop()

Stop recording.

record_stroke()

Record a brush stroke.

Args:

ras: RAS coordinates. erase: Whether this was an erase stroke.

record_param_change()

Record a parameter change.

Args:

name: Parameter name. value: New value.

save()

Save recording as a Python recipe file.

Args:

output_path: Path for the output file.

is_recording()

Check if currently recording.

get_global_recorder()

Get or create the global recipe recorder.

start_recording()

Start global recording session.

stop_recording()

Stop global recording.

is_recording()

Check if global recording is active.