Skip to content

ismms-himc/qupath-annotation-alignment

Repository files navigation

qupath-annotation-alignment

QuPath scripts for alignment and transfer of slide annotations from one image to another

Requirements:

Optional:

Example HIMC workflow for transferring annotations from .ndpi H&E image and to a mirrored IF image:

  1. Make new qupath project or open existing qupath project
  2. Open .ndpi file in qupath project
  3. Run ndpi_and flip.groovy using qupath script editor
  4. Open IF image in qupath project
  5. Open alignment tool
  6. Open H&E image as overlay in alignment tool
  7. Manually align H&E to IF (alter affine transform matrix directly to change overlay scale, shift+right click+drag overlay to translate, rotate overlay using rotation buttons.
  8. Copy affine transform matrix at bottom of alignment tool and paste over the values of the variable matrix in intransferAnnotations.groovy
  9. Copy the the name of the image you want to transfer annotations from - in this case it should end with (AffineTransform[[something], [something]])
  10. With IF image open, run transferAnnotations.groovy
  11. In IF image, double click to select and move/edit any annotations that require it.
  12. (Optional) Run merge_rename_and_export_annotations.groovy to consolidate and rename annotations of each annotation class. Exports these annotations as a .geojson file as well. Before running, edit class_names and class_types so that class_names[i] is the current annotation class/color hexcode corresponding to class_types[i] (Example - class_names[0] ="#000000" and class_types[0]="Tumor"). Edit outpath to be the folder you want to export the annotation .geojson file to. This .geojson file will have the same name as its corresponding image file.

About

QuPath scripts for alignment and transfer of slide annotations from one image to another

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages