Skip to content

Commit

Permalink
Add datetime to segmentation name.
Browse files Browse the repository at this point in the history
  • Loading branch information
andylassiter committed Jul 31, 2024
1 parent 9a361f4 commit 48958b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main_xnat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import logging
import sys
import datetime

import requests
from requests.auth import HTTPBasicAuth
Expand Down Expand Up @@ -59,11 +60,13 @@ def main():
try:
pipeline = SegmentationPipeline(**kwargs)
pipeline.run_pipeline()

dt = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
for (series, segmentation_tup) in pipeline.dicom_segmentations.items():
series_short = series.split('.')[-1]
for (fp, seg_ds) in segmentation_tup:
upload_to_xnat(kwargs['host'], kwargs['username'], kwargs['password'], kwargs['project'],
kwargs['session_id'], f'DR2UnetSegmentation_{series_short}', fp)
kwargs['session_id'], f'DR2UnetSegmentation_{series_short}_{dt}', fp)

except Exception as e:
logging.error('Error running pipeline: %s', e)
Expand Down

0 comments on commit 48958b1

Please sign in to comment.