endoreg-db 0.1.0__py3-none-any.whl → 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- endoreg_db/data/__init__.py +14 -0
- endoreg_db/data/active_model/data.yaml +3 -0
- endoreg_db/data/center/data.yaml +7 -0
- endoreg_db/data/endoscope_type/data.yaml +11 -0
- endoreg_db/data/endoscopy_processor/data.yaml +45 -0
- endoreg_db/data/examination/examinations/data.yaml +17 -0
- endoreg_db/data/examination/time/data.yaml +48 -0
- endoreg_db/data/examination/time-type/data.yaml +8 -0
- endoreg_db/data/examination/type/data.yaml +5 -0
- endoreg_db/data/information_source/data.yaml +30 -0
- endoreg_db/data/label/label/data.yaml +62 -0
- endoreg_db/data/label/label-set/data.yaml +18 -0
- endoreg_db/data/label/label-type/data.yaml +7 -0
- endoreg_db/data/model_type/data.yaml +7 -0
- endoreg_db/data/profession/data.yaml +70 -0
- endoreg_db/data/unit/data.yaml +17 -0
- endoreg_db/data/unit/length.yaml +31 -0
- endoreg_db/data/unit/volume.yaml +26 -0
- endoreg_db/data/unit/weight.yaml +31 -0
- endoreg_db/forms/__init__.py +2 -0
- endoreg_db/forms/settings/__init__.py +8 -0
- endoreg_db/forms/unit.py +6 -0
- endoreg_db/management/commands/_load_model_template.py +41 -0
- endoreg_db/management/commands/delete_legacy_images.py +19 -0
- endoreg_db/management/commands/delete_legacy_videos.py +17 -0
- endoreg_db/management/commands/extract_legacy_video_frames.py +18 -0
- endoreg_db/management/commands/fetch_legacy_image_dataset.py +32 -0
- endoreg_db/management/commands/import_legacy_images.py +94 -0
- endoreg_db/management/commands/import_legacy_videos.py +76 -0
- endoreg_db/management/commands/load_active_model_data.py +45 -0
- endoreg_db/management/commands/load_ai_model_data.py +45 -0
- endoreg_db/management/commands/load_base_db_data.py +62 -0
- endoreg_db/management/commands/load_center_data.py +43 -0
- endoreg_db/management/commands/load_endoscope_type_data.py +45 -0
- endoreg_db/management/commands/load_endoscopy_processor_data.py +45 -0
- endoreg_db/management/commands/load_examination_data.py +75 -0
- endoreg_db/management/commands/load_information_source.py +45 -0
- endoreg_db/management/commands/load_label_data.py +67 -0
- endoreg_db/management/commands/load_profession_data.py +44 -0
- endoreg_db/management/commands/load_unit_data.py +46 -0
- endoreg_db/management/commands/load_user_groups.py +67 -0
- endoreg_db/management/commands/register_ai_model.py +65 -0
- endoreg_db/migrations/0001_initial.py +582 -0
- endoreg_db/models/__init__.py +53 -0
- endoreg_db/models/ai_model/__init__.py +3 -0
- endoreg_db/models/ai_model/active_model.py +9 -0
- endoreg_db/models/ai_model/model_meta.py +24 -0
- endoreg_db/models/ai_model/model_type.py +26 -0
- endoreg_db/models/ai_model/utils.py +8 -0
- endoreg_db/models/annotation/__init__.py +2 -0
- endoreg_db/models/annotation/binary_classification_annotation_task.py +80 -0
- endoreg_db/models/annotation/image_classification.py +27 -0
- endoreg_db/models/center.py +19 -0
- endoreg_db/models/data_file/__init__.py +4 -0
- endoreg_db/models/data_file/base_classes/__init__.py +3 -0
- endoreg_db/models/data_file/base_classes/abstract_frame.py +51 -0
- endoreg_db/models/data_file/base_classes/abstract_video.py +200 -0
- endoreg_db/models/data_file/frame.py +45 -0
- endoreg_db/models/data_file/report_file.py +88 -0
- endoreg_db/models/data_file/video/__init__.py +7 -0
- endoreg_db/models/data_file/video/import_meta.py +25 -0
- endoreg_db/models/data_file/video/video.py +25 -0
- endoreg_db/models/data_file/video_segment.py +107 -0
- endoreg_db/models/examination/__init__.py +4 -0
- endoreg_db/models/examination/examination.py +26 -0
- endoreg_db/models/examination/examination_time.py +27 -0
- endoreg_db/models/examination/examination_time_type.py +24 -0
- endoreg_db/models/examination/examination_type.py +18 -0
- endoreg_db/models/hardware/__init__.py +2 -0
- endoreg_db/models/hardware/endoscope.py +44 -0
- endoreg_db/models/hardware/endoscopy_processor.py +143 -0
- endoreg_db/models/information_source.py +22 -0
- endoreg_db/models/label/__init__.py +1 -0
- endoreg_db/models/label/label.py +84 -0
- endoreg_db/models/legacy_data/__init__.py +3 -0
- endoreg_db/models/legacy_data/image.py +34 -0
- endoreg_db/models/patient_examination/__init__.py +35 -0
- endoreg_db/models/persons/__init__.py +4 -0
- endoreg_db/models/persons/examiner/__init__.py +2 -0
- endoreg_db/models/persons/examiner/examiner.py +16 -0
- endoreg_db/models/persons/examiner/examiner_type.py +2 -0
- endoreg_db/models/persons/patient.py +58 -0
- endoreg_db/models/persons/person.py +34 -0
- endoreg_db/models/persons/portal_user_information.py +29 -0
- endoreg_db/models/prediction/__init__.py +2 -0
- endoreg_db/models/prediction/image_classification.py +37 -0
- endoreg_db/models/prediction/video_prediction_meta.py +244 -0
- endoreg_db/models/unit.py +20 -0
- endoreg_db/queries/__init__.py +5 -0
- endoreg_db/queries/annotations/__init__.py +3 -0
- endoreg_db/queries/annotations/legacy.py +159 -0
- endoreg_db/queries/get/__init__.py +6 -0
- endoreg_db/queries/get/annotation.py +0 -0
- endoreg_db/queries/get/center.py +42 -0
- endoreg_db/queries/get/model.py +13 -0
- endoreg_db/queries/get/patient.py +14 -0
- endoreg_db/queries/get/patient_examination.py +20 -0
- endoreg_db/queries/get/prediction.py +0 -0
- endoreg_db/queries/get/report_file.py +33 -0
- endoreg_db/queries/get/video.py +31 -0
- endoreg_db/queries/get/video_import_meta.py +0 -0
- endoreg_db/queries/get/video_prediction_meta.py +0 -0
- endoreg_db/queries/sanity/__init_.py +0 -0
- endoreg_db/serializers/__init__.py +10 -0
- endoreg_db/serializers/ai_model.py +19 -0
- endoreg_db/serializers/annotation.py +17 -0
- endoreg_db/serializers/center.py +11 -0
- endoreg_db/serializers/examination.py +33 -0
- endoreg_db/serializers/frame.py +13 -0
- endoreg_db/serializers/hardware.py +21 -0
- endoreg_db/serializers/label.py +22 -0
- endoreg_db/serializers/patient.py +10 -0
- endoreg_db/serializers/prediction.py +15 -0
- endoreg_db/serializers/report_file.py +7 -0
- endoreg_db/serializers/video.py +27 -0
- endoreg_db-0.2.1.dist-info/LICENSE +674 -0
- endoreg_db-0.2.1.dist-info/METADATA +27 -0
- endoreg_db-0.2.1.dist-info/RECORD +126 -0
- endoreg_db-0.1.0.dist-info/METADATA +0 -19
- endoreg_db-0.1.0.dist-info/RECORD +0 -10
- {endoreg_db-0.1.0.dist-info → endoreg_db-0.2.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from endoreg_db.models import PatientExamination
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
def get_patient_examinations() -> PatientExamination:
|
|
5
|
+
"""
|
|
6
|
+
Returns all PatientExamination objects from the database.
|
|
7
|
+
"""
|
|
8
|
+
return PatientExamination.objects.all()
|
|
9
|
+
|
|
10
|
+
def get_patient_examinations_without_report_file() -> PatientExamination:
|
|
11
|
+
"""
|
|
12
|
+
Returns all PatientExamination objects from the database without a report_file.
|
|
13
|
+
"""
|
|
14
|
+
return PatientExamination.objects.filter(report_file__isnull=True)
|
|
15
|
+
|
|
16
|
+
def get_patient_examinations_without_video() -> PatientExamination:
|
|
17
|
+
"""
|
|
18
|
+
Returns all PatientExamination objects from the database without a video.
|
|
19
|
+
"""
|
|
20
|
+
return PatientExamination.objects.filter(video__isnull=True)
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from endoreg_db.models import ReportFile
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
def get_report_files() -> ReportFile:
|
|
5
|
+
"""
|
|
6
|
+
Returns all ReportFile objects from the database.
|
|
7
|
+
"""
|
|
8
|
+
return ReportFile.objects.all()
|
|
9
|
+
|
|
10
|
+
def get_report_file_by_id(id) -> Optional[ReportFile]:
|
|
11
|
+
"""Retrieve a ReportFile object by its id.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
id (int): The id of the report_file to retrieve.
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
Optional[ReportFile]: The ReportFile object with the given id, or None if it does not exist.
|
|
18
|
+
"""
|
|
19
|
+
return ReportFile.objects.get(id=id)
|
|
20
|
+
|
|
21
|
+
def get_report_files_without_examination() -> ReportFile:
|
|
22
|
+
"""
|
|
23
|
+
Returns all ReportFile objects from the database without an examination.
|
|
24
|
+
"""
|
|
25
|
+
return ReportFile.objects.filter(patient_examination__isnull=True)
|
|
26
|
+
|
|
27
|
+
def get_report_files_without_patient() -> ReportFile:
|
|
28
|
+
"""
|
|
29
|
+
Returns all ReportFile objects from the database without a patient.
|
|
30
|
+
"""
|
|
31
|
+
return ReportFile.objects.filter(patient__isnull=True)
|
|
32
|
+
|
|
33
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from endoreg_db.models import Video, PatientExamination
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
def get_videos() -> Video:
|
|
5
|
+
"""
|
|
6
|
+
Returns all Video objects from the database.
|
|
7
|
+
"""
|
|
8
|
+
return Video.objects.all()
|
|
9
|
+
|
|
10
|
+
def get_video_by_id(id) -> Optional[Video]:
|
|
11
|
+
"""Retrieve a Video object by its id.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
id (int): The id of the video to retrieve.
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
Optional[Video]: The Video object with the given id, or None if it does not exist.
|
|
18
|
+
"""
|
|
19
|
+
return Video.objects.get(id=id)
|
|
20
|
+
|
|
21
|
+
def get_video_without_examination() -> Video:
|
|
22
|
+
"""
|
|
23
|
+
Returns all Video objects from the database without an examination.
|
|
24
|
+
"""
|
|
25
|
+
return Video.objects.filter(patient_examination__isnull=True)
|
|
26
|
+
|
|
27
|
+
def get_video_without_patient() -> Video:
|
|
28
|
+
"""
|
|
29
|
+
Returns all Video objects from the database without a patient.
|
|
30
|
+
"""
|
|
31
|
+
return Video.objects.filter(patient__isnull=True)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from endoreg_db.models import ModelMeta, ModelType, ActiveModel
|
|
2
|
+
from rest_framework import serializers
|
|
3
|
+
|
|
4
|
+
class ModelMetaSerializer(serializers.ModelSerializer):
|
|
5
|
+
weights = serializers.FileField(use_url=True) # use_url=True will provide the file's URI
|
|
6
|
+
|
|
7
|
+
class Meta:
|
|
8
|
+
model = ModelMeta
|
|
9
|
+
fields = '__all__'
|
|
10
|
+
|
|
11
|
+
class ModelTypeSerializer(serializers.ModelSerializer):
|
|
12
|
+
class Meta:
|
|
13
|
+
model = ModelType
|
|
14
|
+
fields = '__all__'
|
|
15
|
+
|
|
16
|
+
class ActiveModelSerializer(serializers.ModelSerializer):
|
|
17
|
+
class Meta:
|
|
18
|
+
model = ActiveModel
|
|
19
|
+
fields = '__all__'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from rest_framework import serializers
|
|
2
|
+
from endoreg_db.models import LegacyBinaryClassificationAnnotationTask, BinaryClassificationAnnotationTask, ImageClassificationAnnotation
|
|
3
|
+
|
|
4
|
+
class LegacyBinaryClassificationAnnotationTaskSerializer(serializers.ModelSerializer):
|
|
5
|
+
class Meta:
|
|
6
|
+
model = LegacyBinaryClassificationAnnotationTask
|
|
7
|
+
fields = '__all__'
|
|
8
|
+
|
|
9
|
+
class BinaryClassificationAnnotationTaskSerializer(serializers.ModelSerializer):
|
|
10
|
+
class Meta:
|
|
11
|
+
model = BinaryClassificationAnnotationTask
|
|
12
|
+
fields = '__all__'
|
|
13
|
+
|
|
14
|
+
class ImageClassificationAnnotationSerializer(serializers.ModelSerializer):
|
|
15
|
+
class Meta:
|
|
16
|
+
model = ImageClassificationAnnotation
|
|
17
|
+
fields = '__all__'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from rest_framework import serializers
|
|
2
|
+
from endoreg_db.models import (
|
|
3
|
+
Examination,
|
|
4
|
+
ExaminationTimeType,
|
|
5
|
+
ExaminationTime,
|
|
6
|
+
ExaminationType,
|
|
7
|
+
PatientExamination
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
class ExaminationTimeTypeSerializer(serializers.ModelSerializer):
|
|
11
|
+
class Meta:
|
|
12
|
+
model = ExaminationTimeType
|
|
13
|
+
fields = '__all__'
|
|
14
|
+
|
|
15
|
+
class ExaminationTimeSerializer(serializers.ModelSerializer):
|
|
16
|
+
class Meta:
|
|
17
|
+
model = ExaminationTime
|
|
18
|
+
fields = '__all__'
|
|
19
|
+
|
|
20
|
+
class ExaminationTypeSerializer(serializers.ModelSerializer):
|
|
21
|
+
class Meta:
|
|
22
|
+
model = ExaminationType
|
|
23
|
+
fields = '__all__'
|
|
24
|
+
|
|
25
|
+
class ExaminationSerializer(serializers.ModelSerializer):
|
|
26
|
+
class Meta:
|
|
27
|
+
model = Examination
|
|
28
|
+
fields = '__all__'
|
|
29
|
+
|
|
30
|
+
class PatientExaminationSerializer(serializers.ModelSerializer):
|
|
31
|
+
class Meta:
|
|
32
|
+
model = PatientExamination
|
|
33
|
+
fields = '__all__'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from rest_framework import serializers
|
|
2
|
+
from endoreg_db.models import Frame, LegacyFrame
|
|
3
|
+
|
|
4
|
+
class FrameSerializer(serializers.ModelSerializer):
|
|
5
|
+
class Meta:
|
|
6
|
+
model = Frame
|
|
7
|
+
fields = '__all__'
|
|
8
|
+
|
|
9
|
+
class LegacyFrameSerializer(serializers.ModelSerializer):
|
|
10
|
+
class Meta:
|
|
11
|
+
model = LegacyFrame
|
|
12
|
+
fields = '__all__'
|
|
13
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from rest_framework import serializers
|
|
2
|
+
from endoreg_db.models import (
|
|
3
|
+
Endoscope,
|
|
4
|
+
EndoscopeType,
|
|
5
|
+
EndoscopyProcessor,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
class EndoscopeSerializer(serializers.ModelSerializer):
|
|
9
|
+
class Meta:
|
|
10
|
+
model = Endoscope
|
|
11
|
+
fields = '__all__'
|
|
12
|
+
|
|
13
|
+
class EndoscopyProcessorSerializer(serializers.ModelSerializer):
|
|
14
|
+
class Meta:
|
|
15
|
+
model = EndoscopyProcessor
|
|
16
|
+
fields = '__all__'
|
|
17
|
+
|
|
18
|
+
class EndoscopeTypeSerializer(serializers.ModelSerializer):
|
|
19
|
+
class Meta:
|
|
20
|
+
model = EndoscopeType
|
|
21
|
+
fields = '__all__'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from rest_framework import serializers
|
|
2
|
+
from endoreg_db.models import (
|
|
3
|
+
Label,
|
|
4
|
+
LabelSet,
|
|
5
|
+
LabelType,
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
class LabelTypeSerializer(serializers.ModelSerializer):
|
|
9
|
+
class Meta:
|
|
10
|
+
model = LabelType
|
|
11
|
+
fields = '__all__'
|
|
12
|
+
|
|
13
|
+
class LabelSetSerializer(serializers.ModelSerializer):
|
|
14
|
+
class Meta:
|
|
15
|
+
model = LabelSet
|
|
16
|
+
fields = '__all__'
|
|
17
|
+
|
|
18
|
+
class LabelSerializer(serializers.ModelSerializer):
|
|
19
|
+
class Meta:
|
|
20
|
+
model = Label
|
|
21
|
+
fields = '__all__'
|
|
22
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from rest_framework import serializers
|
|
2
|
+
from endoreg_db.models import (
|
|
3
|
+
ImageClassificationPrediction,
|
|
4
|
+
LegacyVideoPredictionMeta
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
class ImageClassificationPredictionSerializer(serializers.ModelSerializer):
|
|
8
|
+
class Meta:
|
|
9
|
+
model = ImageClassificationPrediction
|
|
10
|
+
fields = '__all__'
|
|
11
|
+
|
|
12
|
+
class LegacyVideoPredictionMetaSerializer(serializers.ModelSerializer):
|
|
13
|
+
class Meta:
|
|
14
|
+
model = LegacyVideoPredictionMeta
|
|
15
|
+
fields = '__all__'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from rest_framework import serializers
|
|
2
|
+
from endoreg_db.models import Video, LegacyVideo, VideoImportMeta, LegacyLabelVideoSegment, LabelVideoSegment
|
|
3
|
+
|
|
4
|
+
class VideoSerializer(serializers.ModelSerializer):
|
|
5
|
+
class Meta:
|
|
6
|
+
model = Video
|
|
7
|
+
fields = '__all__'
|
|
8
|
+
|
|
9
|
+
class LegacyVideoSerializer(serializers.ModelSerializer):
|
|
10
|
+
class Meta:
|
|
11
|
+
model = LegacyVideo
|
|
12
|
+
fields = '__all__'
|
|
13
|
+
|
|
14
|
+
class VideoImportMetaSerializer(serializers.ModelSerializer):
|
|
15
|
+
class Meta:
|
|
16
|
+
model = VideoImportMeta
|
|
17
|
+
fields = '__all__'
|
|
18
|
+
|
|
19
|
+
class LabelVideoSegmentSerializer(serializers.ModelSerializer):
|
|
20
|
+
class Meta:
|
|
21
|
+
model = LabelVideoSegment
|
|
22
|
+
fields = '__all__'
|
|
23
|
+
|
|
24
|
+
class LegacyLabelVideoSegmentSerializer(serializers.ModelSerializer):
|
|
25
|
+
class Meta:
|
|
26
|
+
model = LegacyLabelVideoSegment
|
|
27
|
+
fields = '__all__'
|