Skip to content

Commit

Permalink
Merge pull request #44 from Leo-Berman/main
Browse files Browse the repository at this point in the history
Updating to main
  • Loading branch information
Leo-Berman authored Oct 9, 2024
2 parents c4a0677 + fb25dbb commit 0d6bdca
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 47 deletions.
12 changes: 0 additions & 12 deletions nedc_mladp/data/Albert_Image_Test.txt

This file was deleted.

29 changes: 0 additions & 29 deletions nedc_mladp/data/Albert_Image_Test.txt~

This file was deleted.

11 changes: 11 additions & 0 deletions nedc_mladp/data/Example_Parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,14 @@ eval_model{
write_region_decisions=<1 if you want region decisions to be written, 0 otherwise>
output_region_decisions_directory=<EXISTING DIRECTORY of where you want your region decisions to be written>
}

gen_graphics{
framesize=6000
imagefile="/data/isip/data/tuh_dpath_breast/deidentified/v3.0.0/svs/eval/00000739_aaaaaadc/s000_2017/breast/00000739_aaaaaadc_s000_0hne_0000_a001_lvl001_t000.svs"
labelfile="/data/isip/data/tuh_dpath_breast/deidentified/v3.0.0/svs/eval/00000739_aaaaaadc/s000_2017/breast/00000739_aaaaaadc_s000_0hne_0000_a001_lvl001_t000.xml"
output_file="test.png"
showframes=0
compression=40
decisions=0
decisions_path=""
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def labeledFrames(labels:list,height:int,width:int,windowsize:int,framesize:int,
# create list of tuples of coordinates compensating for column row format vs traditional
# x,y format
#
ret_coords.append((int(labeled_list[x][0][0]),int(height - labeled_list[x][0][1]+framesize)))
ret_coords.append((int(labeled_list[x][0][0]),int(labeled_list[x][0][1])))

# return the top left coordinates of each frame and their corresponding labels
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def read_feature_files(feature_file_list:list,get_header=False):
else:
row_list = list(row)
labels.append(row_list.pop(0)) # label

xcoords.append(row_list.pop(0)) # x coord
ycoords.append(row_list.pop(0)) # y coord
framesizes.append(row_list.pop(0)) # framesize
Expand Down Expand Up @@ -158,7 +159,11 @@ def parseAnnotations(file):

# convert from row,column,depth into traditional (x,y) coordinates
#
coords[i][j][0] = int(header['height'])-coords[i][j][0]
tmp1 = coords[i][j][0]

coords[i][j][0] = int(header['height']) - coords[i][j][1]
coords[i][j][1] = tmp1

coords[i][j].pop()
coords[i][j].reverse()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#------------------------------------------------------------------------------
from PIL import Image
import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle

Expand Down Expand Up @@ -74,7 +76,7 @@ def main():
#
args_usage = "nedc_mladp_gen_graphics.usage"
args_help = "nedc_mladp_gen_graphics.help"
parameter_file = fileio_tools.parameters_only_args(args_usage,args_help)
parameter_file = fileio_tools.parseArguments(args_usage,args_help)

# parse parameters
#
Expand All @@ -90,7 +92,7 @@ def main():

# parse annotations
#
header, ids, labels, coordinates = fileio_tools.parse_annotations(label_file)
header, ids, labels, coordinates = fileio_tools.parseAnnotations(label_file)

# get height and width of image (in pixels) from the header
#
Expand All @@ -99,7 +101,7 @@ def main():

# get labeled regions
#
labeled_regions = ann_tools.labeled_regions(coordinates)
labeled_regions = ann_tools.labeledRegions(coordinates)


'''plt.figure().clear()
Expand All @@ -115,7 +117,6 @@ def main():

plt.plot(x,y,color = labelsdict[labels[i]])
plt.text(coordinates[i][0][0],coordinates[i][0][1],labels[i])

# generate the background image and return the background image's filepath
#
image_loc = svs_to_jpg(image_file,output_file,compression)
Expand Down

0 comments on commit 0d6bdca

Please sign in to comment.