# Generated by Django 2.2.6 on 2019-10-15 09:57

import uuid

import django.core.validators
import django.db.models.deletion
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [migrations.swappable_dependency(settings.AUTH_USER_MODEL)]

    operations = [
        migrations.CreateModel(
            name="LookUpTable",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "title",
                    models.CharField(max_length=255, verbose_name="title"),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, null=True, verbose_name="description"
                    ),
                ),
                (
                    "slug",
                    django_extensions.db.fields.AutoSlugField(
                        blank=True,
                        editable=False,
                        populate_from="title",
                        verbose_name="slug",
                    ),
                ),
                (
                    "color",
                    models.TextField(
                        validators=[
                            django.core.validators.RegexValidator(
                                regex="^\\[(?:((?: ?-?\\d*(?:\\.\\d+)? ){3}(?:-?\\d*(?:\\.\\d+)?)) ?, ?)+((?:-?\\d*(?:\\.\\d+)? ){3}(?:\\d*(:?\\.\\d+)? ?))\\]$"
                            )
                        ]
                    ),
                ),
                (
                    "alpha",
                    models.TextField(
                        validators=[
                            django.core.validators.RegexValidator(
                                regex="^\\[(?:((?: ?-?\\d*(?:\\.\\d+)? ){1}(?:-?\\d*(?:\\.\\d+)?)) ?, ?)+((?:-?\\d*(?:\\.\\d+)? ){1}(?:\\d*(:?\\.\\d+)? ?))\\]$"
                            )
                        ]
                    ),
                ),
                (
                    "color_invert",
                    models.TextField(
                        blank=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                regex="^\\[(?:((?: ?-?\\d*(?:\\.\\d+)? ){3}(?:-?\\d*(?:\\.\\d+)?)) ?, ?)+((?:-?\\d*(?:\\.\\d+)? ){3}(?:\\d*(:?\\.\\d+)? ?))\\]$"
                            )
                        ],
                    ),
                ),
                (
                    "alpha_invert",
                    models.TextField(
                        blank=True,
                        validators=[
                            django.core.validators.RegexValidator(
                                regex="^\\[(?:((?: ?-?\\d*(?:\\.\\d+)? ){1}(?:-?\\d*(?:\\.\\d+)?)) ?, ?)+((?:-?\\d*(?:\\.\\d+)? ){1}(?:\\d*(:?\\.\\d+)? ?))\\]$"
                            )
                        ],
                    ),
                ),
                ("range_min", models.SmallIntegerField(default=0)),
                ("range_max", models.SmallIntegerField(default=4095)),
                ("relative", models.BooleanField(default=False)),
                (
                    "color_interpolation",
                    models.CharField(
                        choices=[
                            ("RGB", "RGB"),
                            ("HLS", "HLS"),
                            ("HLSpos", "HLS Positive"),
                            ("HLSneg", "HLS Negative"),
                            ("Constant", "Constant"),
                        ],
                        default="RGB",
                        max_length=8,
                    ),
                ),
                (
                    "color_interpolation_invert",
                    models.CharField(
                        choices=[
                            ("RGB", "RGB"),
                            ("HLS", "HLS"),
                            ("HLSpos", "HLS Positive"),
                            ("HLSneg", "HLS Negative"),
                            ("Constant", "Constant"),
                        ],
                        default="RGB",
                        max_length=8,
                    ),
                ),
            ],
            options={"ordering": ("title",), "abstract": False},
        ),
        migrations.CreateModel(
            name="WindowPreset",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "title",
                    models.CharField(max_length=255, verbose_name="title"),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, null=True, verbose_name="description"
                    ),
                ),
                (
                    "slug",
                    django_extensions.db.fields.AutoSlugField(
                        blank=True,
                        editable=False,
                        populate_from="title",
                        verbose_name="slug",
                    ),
                ),
                (
                    "width",
                    models.PositiveIntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(
                                limit_value=1
                            )
                        ]
                    ),
                ),
                ("center", models.IntegerField()),
            ],
            options={"ordering": ("title",), "abstract": False},
        ),
        migrations.CreateModel(
            name="WorkstationConfig",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("modified", models.DateTimeField(auto_now=True)),
                (
                    "title",
                    models.CharField(max_length=255, verbose_name="title"),
                ),
                (
                    "description",
                    models.TextField(
                        blank=True, null=True, verbose_name="description"
                    ),
                ),
                (
                    "slug",
                    django_extensions.db.fields.AutoSlugField(
                        blank=True,
                        editable=False,
                        populate_from="title",
                        verbose_name="slug",
                    ),
                ),
                (
                    "default_slab_thickness_mm",
                    models.DecimalField(
                        blank=True,
                        decimal_places=2,
                        max_digits=4,
                        null=True,
                        validators=[
                            django.core.validators.MinValueValidator(
                                limit_value=0.01
                            )
                        ],
                    ),
                ),
                (
                    "default_slab_render_method",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("MAX", "Maximum"),
                            ("MIN", "Minimum"),
                            ("AVG", "Average"),
                        ],
                        max_length=3,
                    ),
                ),
                (
                    "default_orientation",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("A", "Axial"),
                            ("C", "Coronal"),
                            ("S", "Sagittal"),
                        ],
                        max_length=1,
                    ),
                ),
                (
                    "default_overlay_interpolation",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("NN", "NearestNeighbour"),
                            ("TL", "Trilinear"),
                        ],
                        default="NN",
                        max_length=2,
                    ),
                ),
                ("show_image_info_plugin", models.BooleanField(default=True)),
                ("show_display_plugin", models.BooleanField(default=True)),
                (
                    "creator",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "default_overlay_lut",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="workstation_configs.LookUpTable",
                    ),
                ),
                (
                    "default_window_preset",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="workstation_default_window_presets",
                        to="workstation_configs.WindowPreset",
                    ),
                ),
                (
                    "window_presets",
                    models.ManyToManyField(
                        blank=True,
                        related_name="workstation_window_presets",
                        to="workstation_configs.WindowPreset",
                    ),
                ),
            ],
            options={"ordering": ("created", "creator"), "abstract": False},
        ),
    ]
