|
|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "π Starting CaNA (Cancer Analysis) Docker container for shrinking..." |
|
|
cd "$(dirname "$0")" |
|
|
|
|
|
|
|
|
docker rm -f cana_pipeline 2>/dev/null || true |
|
|
|
|
|
|
|
|
echo "π¦ Launching ft42/pins:latest container..." |
|
|
docker run -d --name cana_pipeline \ |
|
|
-v "$(pwd):/app" \ |
|
|
-w /app \ |
|
|
ft42/pins:latest \ |
|
|
tail -f /dev/null |
|
|
|
|
|
|
|
|
echo "π Setting up output directories and permissions..." |
|
|
docker exec cana_pipeline mkdir -p /app/demofolder/output/CaNA_shrinked_75_output |
|
|
docker exec cana_pipeline chmod 777 /app/demofolder/output/CaNA_shrinked_75_output |
|
|
|
|
|
|
|
|
echo "π§ Installing missing Python packages if needed..." |
|
|
docker exec cana_pipeline pip install nibabel scikit-image > /dev/null 2>&1 || echo "β οΈ Some packages may already be installed" |
|
|
|
|
|
echo "β
Docker container is running with all dependencies" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "π¬ Running CaNA (Cancer Analysis) lung nodule shrinking processing..." |
|
|
|
|
|
docker exec cana_pipeline python CaNA_LungNoduleSize_shrinked.py \ |
|
|
--json_path ./demofolder/data/Experiments_DLCSD24_512xy_256z_771p25m_dataset.json \ |
|
|
--dict_to_read "training" \ |
|
|
--data_root ./demofolder/data/ \ |
|
|
--lunglesion_lbl 23 \ |
|
|
--scale_percent 75 \ |
|
|
--log_file /app/demofolder/output/CaNA_shrinking_75.log \ |
|
|
--save_dir /app/demofolder/output/CaNA_shrinked_75_output \ |
|
|
--random_seed 42 \ |
|
|
--prefix Aug23s75_ \ |
|
|
--csv_output /app/demofolder/output/CaNA_shrinking_75_stats.csv |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ $? -eq 0 ]; then |
|
|
echo "β
CaNA shrinking processing completed successfully!" |
|
|
echo "π Check ./demofolder/output/ directory for results:" |
|
|
echo " - Processing log: CaNA_shrinking_75.log" |
|
|
echo " - Shrinked masks: CaNA_shrinked_75_output/" |
|
|
echo " - Statistics CSV: CaNA_shrinking_75_stats.csv" |
|
|
echo " - File prefix: Aug23s75_" |
|
|
else |
|
|
echo "β CaNA shrinking processing failed. Check the logs above for errors." |
|
|
fi |
|
|
|
|
|
|
|
|
echo "π§Ή Cleaning up Docker container..." |
|
|
docker stop cana_pipeline > /dev/null 2>&1 |
|
|
docker rm cana_pipeline > /dev/null 2>&1 |
|
|
|
|
|
echo "π CaNA shrinking pipeline execution complete!" |