Add All Folders

This commit is contained in:
soorena62
2026-02-08 04:38:10 +03:30
commit 9bb57e4799
191 changed files with 8469 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
## README For **Dagster_Minimal_Mode**
```markdown
# Dagster Minimal Mode Project
This project demonstrates the radiomics workflow in **Dagster Minimal Mode**.
Minimal Mode is a lightweight configuration of Dagster, focusing on simplicity and reduced overhead.
## Features
- Minimal orchestration setup for radiomics extraction.
- Direct execution of ops/assets without full Dagster deployment.
- Simplified configuration for quick testing and prototyping.
## Requirements
- Python 3.10+
- Dagster (minimal mode enabled)
- SimpleITK
- Pandas
- PySERA
Install dependencies:
```bash
pip install dagster simpleitk pandas pysera
# Running:
python radiuma_pipeline.py
@@ -0,0 +1,11 @@
from dagster import op
import pysera
@op
def extract_features(inputs):
result = pysera.process_batch(
image_input="data/images/ourT1.nii.gz",
mask_input="data/masks/ourT1_mask.nii.gz",
output_path="artifacts"
)
return result
@@ -0,0 +1,74 @@
# ops_reader.py
from dagster import op
import os
import pysera
@op
def read_images():
# Match Radiuma.exe by processing a single pair or a flat folder.
# Here we keep folders; PySERA will find matching pairs.
image_dir = "data/images"
mask_dir = "data/masks"
return {"image_dir": image_dir, "mask_dir": mask_dir}
@op
def extract_features(data):
# Exact PySERA config mirrored from Radiuma.exe logs
result = pysera.process_batch(
image_input=data["image_dir"],
mask_input=data["mask_dir"],
output_path="./artifacts/results",
# Core run behavior
enable_parallelism=False,
num_workers=1,
apply_preprocessing=True,
roi_selection_mode="per_region",
roi_num=2,
min_roi_volume=50,
feature_value_mode="REAL_VALUE",
# Feature scope
categories="diag,morph,glcm,glrlm,glszm,ngtdm,ngldm",
dimensions="1st,2D",
bin_size=25,
# Logging/report
report="info",
# Temp path (matching Radiuma.exe run)
temporary_files_path=r"C:\Users\Omen16\AppData\Local\ViSERA\res\memory\memmap\pysera_temp",
# IBSI-based parameters mirrored from Radiuma.exe
IBSI_based_parameters={
"radiomics_DataType": "CT",
"radiomics_DiscType": "FBS",
"radiomics_isScale": 0,
"radiomics_VoxInterp": "Nearest",
"radiomics_ROIInterp": "Nearest",
"radiomics_isotVoxSize": 1.0,
"radiomics_isotVoxSize2D": 2.0,
"radiomics_isIsot2D": 0,
"radiomics_isGLround": 0,
"radiomics_isReSegRng": 0,
"radiomics_isOutliers": 0,
"radiomics_isQuntzStat": 1,
"radiomics_ReSegIntrvl01": -1000,
"radiomics_ReSegIntrvl02": 400,
"radiomics_ROI_PV": 0.5,
"radiomics_qntz": "Uniform",
"radiomics_IVH_Type": 3,
"radiomics_IVH_DiscCont": 1,
"radiomics_IVH_binSize": 2.0,
},
)
return result
@op
def write_report(result):
os.makedirs("artifacts", exist_ok=True)
report_path = "artifacts/radiomics_batch_report_radiuma_match.txt"
with open(report_path, "w") as f:
f.write(f"Success: {result['success']}\n")
f.write(f"Processed files: {result['processed_files']}\n")
f.write(f"Processing time: {result['processing_time']:.2f} seconds\n")
f.write(f"Output path: {result['output_path']}\n")
f.write("Note: Excel with Radiomics_Features, Parameters, Report is saved in output_path.\n")
return report_path
@@ -0,0 +1,9 @@
from dagster import op
@op
def write_report(features):
with open("artifacts/final_report.txt", "w", encoding="utf-8") as f:
f.write("# Radiomics Report\n")
f.write(f"Extracted {len(features)} features\n")
for k, v in features.items():
f.write(f"{k},{v}\n")
@@ -0,0 +1,8 @@
# radiuma_pipeline.py
from dagster import job
from ops_reader import read_images, extract_features, write_report
@job
def radiuma_job():
result = extract_features(read_images())
write_report(result)
@@ -0,0 +1,97 @@
alembic==1.17.2
annotated-types==0.7.0
antlr4-python3-runtime==4.13.2
anyio==4.12.0
backoff==2.2.1
certifi==2025.11.12
charset-normalizer==3.4.4
click==8.3.1
colorama==0.4.6
coloredlogs==14.0
connected-components-3d==3.26.1
dagit==1.12.6
dagster==1.12.6
dagster-graphql==1.12.6
dagster-pipes==1.12.6
dagster-webserver==1.12.6
dagster_shared==1.12.6
dataclasses==0.6
docstring_parser==0.17.0
et_xmlfile==2.0.0
filelock==3.20.0
fsspec==2025.12.0
gql==3.5.3
graphene==3.4.3
graphql-core==3.2.6
graphql-relay==3.2.0
greenlet==3.3.0
grpcio==1.76.0
grpcio-health-checking==1.76.0
h11==0.16.0
httptools==0.7.1
humanfriendly==10.0
idna==3.11
ImageIO==2.37.2
Jinja2==3.1.6
joblib==1.5.2
lazy_loader==0.4
Mako==1.3.10
markdown-it-py==4.0.0
MarkupSafe==3.0.3
mdurl==0.1.2
multidict==6.7.0
networkx==3.6.1
nibabel==5.3.3
numpy==2.2.6
opencv-python==4.12.0.88
openpyxl==3.1.5
packaging==25.0
pandas==2.3.3
pathlib_abc==0.5.2
pillow==12.0.0
platformdirs==4.5.1
propcache==0.4.1
protobuf==6.33.2
psutil==7.1.3
pydantic==2.12.5
pydantic_core==2.41.5
pydicom==3.0.1
Pygments==2.19.2
pynrrd==1.1.3
pyreadline3==3.5.4
pysera==2.1.5
python-dateutil==2.9.0.post0
python-dotenv==1.2.1
pytz==2025.2
pywin32==311
PyYAML==6.0.3
requests==2.32.5
requests-toolbelt==1.0.0
rich==14.2.0
rt-utils==1.2.7
scikit-image==0.25.2
scikit-learn==1.8.0
scipy==1.16.3
setuptools==80.9.0
simpleitk==2.5.3
six==1.17.0
SQLAlchemy==2.0.45
starlette==0.50.0
structlog==25.5.0
tabulate==0.9.0
threadpoolctl==3.6.0
tifffile==2025.10.16
tomli==2.3.0
tomlkit==0.13.3
toposort==1.10
tqdm==4.67.1
typing-inspection==0.4.2
typing_extensions==4.15.0
tzdata==2025.2
universal_pathlib==0.3.7
urllib3==2.6.2
uvicorn==0.38.0
watchdog==6.0.0
watchfiles==1.1.1
websockets==15.0.1
yarl==1.22.0