Skip to content

Add svs mappings #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added mappings/test_svs_mappings/svs_mappings.json.gz
Binary file not shown.
28 changes: 28 additions & 0 deletions mappings/test_svs_mappings/svs_mappings/device_exposure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Table name: device_exposure

### Reading from svs_metadata.csv

![](md_files/image1.png)

| Destination Field | Source field | Logic | Comment field |
| --- | --- | --- | --- |
| device_exposure_id | | | |
| person_id | | | |
| device_concept_id | | | |
| device_exposure_start_date | | | |
| device_exposure_start_datetime | | | |
| device_exposure_end_date | | | |
| device_exposure_end_datetime | | | |
| device_type_concept_id | | | |
| unique_device_id | aperio.dsr id<br>aperio.scanscope id | | Scanner details could also map to device_exposure for more detailed implementations.<br>Could be used to represent the scanning device used to capture the image. |
| production_id | | | |
| quantity | | | |
| provider_id | aperio.user | | Connects the device user to the specific provider involved in capturing the image.<br> |
| visit_occurrence_id | | | |
| visit_detail_id | | | |
| device_source_value | | | |
| device_source_concept_id | | | |
| unit_concept_id | | | |
| unit_source_value | | | |
| unit_source_concept_id | | | |

44 changes: 44 additions & 0 deletions mappings/test_svs_mappings/svs_mappings/image_feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Table name: image_feature

### Reading from svs_thumbnail.csv

![](md_files/image3.png)

| Destination Field | Source field | Logic | Comment field |
| --- | --- | --- | --- |
| feature_id | | | |
| image_id | | | |
| feature_type | x<br>y<br>red<br>green<br>blue | Assign feature_type_concept_id = <concept_id_for_X_Coordinate>, where concept ID represents the X-coordinate feature type. Example: 1234567.<br>Assign feature_type_concept_id = <concept_id_for_Y_Coordinate>, where concept ID represents the Y-coordinate feature type. Example: 1234567.<br>Assign feature_type_concept_id = <concept_id_for_Red_Channel_Intensity>, where concept ID represents the Red intensity feature. Example: 2345678.<br>Assign feature_type_concept_id = <concept_id_for_Green_Channel_Intensity>, where concept ID represents the Green intensity feature. Example: 2345679.<br>Assign feature_type_concept_id = <concept_id_for_Blue_Channel_Intensity>, where concept ID represents the Blue intensity feature. Example: 2345680. | Feature Type should represent the type of measurement or attribute you are capturing. This is for X coordinate. (X and Y represent the spatial position of a pixel.)<br>Feature Type should represent the type of measurement or attribute you are capturing. This is for Y coordinate. (X and Y represent the spatial position of a pixel.)<br>The feature is Red channel intensity (feature type)<br>The feature is Green channel intensity (feature type)<br>The feature is Blue channel intensity (feature type)<br> |
| feature_value | x<br>y<br>blue<br>red<br>green | | Actual value from the source CSV (e.g., the X-coordinate value itself).<br>Actual value from the source CSV (e.g., the Y-coordinate value itself).<br>The actual value for the Blue channel intensity<br>The actual value for the Red channel intensity<br>The actual value for the Green channel intensity<br> |
| unit_concept_id | | | |
| extraction_method | | | |
| date_of_extraction | | | |

### Reading from svs_image_data.csv

![](md_files/image4.png)

| Destination Field | Source field | Logic | Comment field |
| --- | --- | --- | --- |
| feature_id | | | |
| image_id | | | |
| feature_type | level<br>width<br>height<br>downsample | Assign feature_type_concept_id = <concept_id_for_level>, where concept ID represents the level feature type. Example: 1234567.<br>Assign feature_type_concept_id = <concept_id_for_width>, where concept ID represents the width feature type. Example: 1234567.<br>Assign feature_type_concept_id = <concept_id_for_width>, where concept ID represents the width feature type. Example: 1234567.<br>Assign feature_type_concept_id = <concept_id_for_downsample>, where concept ID represents the downsample feature type. Example: 1234567. | Level of the image pyramid (used for multi-resolution images).<br>Width of the original image (or downsampled image level).<br>Height of the original image (or downsampled image level).<br>Represents how much the image has been downsampled at each level.<br> |
| feature_value | downsample<br>height<br>width<br>level | | The actual downsample value for the image<br>The actual height value of the image<br>The actual width value of the image<br>The actual level value of the image<br> |
| unit_concept_id | | | |
| extraction_method | | | |
| date_of_extraction | | | |

### Reading from svs_metadata.csv

![](md_files/image5.png)

| Destination Field | Source field | Logic | Comment field |
| --- | --- | --- | --- |
| feature_id | | | |
| image_id | | | |
| feature_type | aperio.appmag<br>aperio.mpp | Assign feature_type_concept_id = <concept_id_for_magnificatione>, where concept ID represents the objective magnification feature type. Example: 123456<br>Assign feature_type_concept_id = <concept_id_for_mpp>, where concept ID represents the microns per pixel feature. Example: 345678. | Describes the image's magnification (e.g., 20x). Concept ID could be for magnification.<br>MPP feature gives the resolution of the image at a pixel level.<br> |
| feature_value | aperio.appmag<br>aperio.mpp<br>aperio.originalheight<br>aperio.originalwidth | | Actual value of the image's magnification (e.g., 20x)<br>Actual value of resolution of the image at a pixel level.<br>Original height of the image<br>Original width of image<br> |
| unit_concept_id | | | |
| extraction_method | | | |
| date_of_extraction | | | |

16 changes: 16 additions & 0 deletions mappings/test_svs_mappings/svs_mappings/image_occurrence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Table name: image_occurrence

### Reading from svs_metadata.csv

![](md_files/image2.png)

| Destination Field | Source field | Logic | Comment field |
| --- | --- | --- | --- |
| image_id | aperio.imageid | | |
| person_id | | | |
| study_id | | | |
| modality | | | |
| body_part_examined | | | |
| date_of_image | aperio.date | | |
| file_location | | | |

14 changes: 14 additions & 0 deletions mappings/test_svs_mappings/svs_mappings/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Source Data Mapping Approach to CDMv5.4

![](md_files/image6.png)

## Contents

[device_exposure](device_exposure.md)

[image_occurrence](image_occurrence.md)

[image_feature](image_feature.md)

[source_appendix](source_appendix.md)

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions mappings/test_svs_mappings/svs_mappings/source_appendix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Appendix: source tables

### Table: svs_image_data.csv

| Field | Type | Most freq. value | Comment |
| --- | --- | --- | --- |
| level | INT | | |
| width | INT | | |
| height | INT | | |
| downsample | REAL | | |

### Table: svs_thumbnail.csv

| Field | Type | Most freq. value | Comment |
| --- | --- | --- | --- |
| x | INT | 110 | |
| y | INT | 88 | |
| red | INT | 243 | |
| green | INT | 243 | |
| blue | INT | 242 | |

### Table: svs_metadata.csv

| Field | Type | Most freq. value | Comment |
| --- | --- | --- | --- |
| aperio.appmag | INT | | |
| aperio.dsr id | VARCHAR | | |
| aperio.date | DATE | | Maps directly to the timestamp for when the image occurrence took place. |
| aperio.displaycolor | INT | | |
| aperio.exposure scale | REAL | | |
| aperio.exposure time | INT | | |
| aperio.filename | INT | | |
| aperio.focus offset | REAL | | |
| aperio.icc profile | VARCHAR | | |
| aperio.imageid | INT | | Maps directly to the identifier for the image occurrence. |
| aperio.left | REAL | | |
| aperio.lineareaxoffset | REAL | | |
| aperio.lineareayoffset | REAL | | |
| aperio.linecameraskew | INT | | |
| aperio.mpp | REAL | | |
| aperio.originalheight | INT | | |
| aperio.originalwidth | INT | | |
| aperio.scanscope id | VARCHAR | | |
| aperio.stripewidth | INT | | |
| aperio.time | VARCHAR | | |
| aperio.time zone | VARCHAR | | |
| aperio.top | REAL | | |
| aperio.user | VARCHAR | | |
| openslide.associated.thumbnail.height | INT | | |
| openslide.associated.thumbnail.width | INT | | |
| openslide.comment | VARCHAR | | |
| 42672x25390 [0 | VARCHAR | | |
| openslide.level-count | INT | | |
| openslide.level[0].downsample | INT | | |
| openslide.level[0].height | INT | | |
| openslide.level[0].tile-height | INT | | |
| openslide.level[0].tile-width | INT | | |
| openslide.level[0].width | INT | | |
| openslide.level[1].downsample | REAL | | |
| openslide.level[1].height | INT | | |
| openslide.level[1].tile-height | INT | | |
| openslide.level[1].tile-width | INT | | |
| openslide.level[1].width | INT | | |
| openslide.level[2].downsample | REAL | | |
| openslide.level[2].height | INT | | |
| openslide.level[2].tile-height | INT | | |
| openslide.level[2].tile-width | INT | | |
| openslide.level[2].width | INT | | |
| openslide.mpp-x | REAL | | |
| openslide.mpp-y | REAL | | |
| openslide.objective-power | INT | | |
| openslide.quickhash-1 | VARCHAR | | |
| openslide.vendor | VARCHAR | | |
| tiff.imagedescription | VARCHAR | | |
| 42672x25390 [0 | VARCHAR | | |
| tiff.resolutionunit | VARCHAR | | |