diff --git a/atlas/api.py b/atlas/api.py index a0d29556..c9d0a6c6 100644 --- a/atlas/api.py +++ b/atlas/api.py @@ -120,6 +120,12 @@ def import_dicoms_helper(request, case_id: int | None = None): else: dicoms = UncategorisedDicom.objects.filter(user=request.user) + + if "order-series" in request.POST: + order = request.POST["order-series"] + else: + order = None + data = defaultdict(list) for d in dicoms: tags = d.basic_dicom_tags @@ -151,6 +157,15 @@ def import_dicoms_helper(request, case_id: int | None = None): series.save() + + match order: + case "order-series-instance-number": + series.order_by_dicom("InstanceNumber") + case "order-series-slice-location": + series.order_by_dicom("SliceLocation") + case _: + pass + # We might only want to add the author during creation.... series.author.add(request.user) diff --git a/atlas/templates/atlas/user_uploads.html b/atlas/templates/atlas/user_uploads.html index 49d31100..2afdd848 100644 --- a/atlas/templates/atlas/user_uploads.html +++ b/atlas/templates/atlas/user_uploads.html @@ -17,13 +17,13 @@ {% for series, n, tags, date in series_list %}
  • - {{date}}: {{series}} [{{n}} images]
    - {{tags}} - -
    + on click toggle .selected on me + then set i to the first in me + then set i.checked to not i.checked" > + {{date}}: {{series}} [{{n}} images]
    + {{tags}} + + Popup @@ -35,6 +35,30 @@ {% if case %}

    Importing into case {{case}}

    {% endif %} +
    Upload settings +
    +
    +
    Select how series should be ordered when uploaded +
    + This will affect how series are displayed when viewing with the built in site viewer. By default when exporting from Insight the order is not maintained so you should choose to order eithre by slice location or instance number.
    + If you are not sure, leave this as the default. +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    +
    +
    {% endif %} @@ -62,6 +86,7 @@ {% else %} No uploads awaiting importing have been found. + {% endif %}

    View orphan series