from core.workflow import Graph
from nodes.image_reader import ImageReader
from nodes.feature_extractor import FeatureExtractor
from nodes.feature_writer import FeatureWriter


graph = Graph()

reader = ImageReader(modality="CT")
extractor = FeatureExtractor()
writer = FeatureWriter()

# ImageReader → FeatureExtractor
ok, msg = graph.can_connect(reader, "image", extractor, "image")
print("Reader → Extractor:", ok, msg)

# FeatureExtractor → FeatureWriter
ok, msg = graph.can_connect(extractor, "features", writer, "features")
print("Extractor → Writer:", ok, msg)
