Scripts to convert ROIs to csvs, csvs to shapefiles using JAVA and Python
Dependencies that need to be installed are geopandas, shapely.geometry, Polygon, pandas, ast, argparse, os
A) To create a shapefile
-
Open image and ROI manager in Imaje-J/FIJI
-
Open File->New Script and switch the Language to JavaScript
-
Copy paste "Coordinate_extractor_IMAGEJ_ROI_V2 code into the editor (or open file)
-
Change the output destination and name on line 16
output_file = new FileWriter("C:/Users.../roi_coordinates.csv");
-
Open command terminal and switch directory to location of "both.py"
-
In command terminal type
C:\Users\nicor> cd 'path to directory with both.py'
-
You should now see the new directory
-
Type
python both.py 'path to .csv file created in javascript above'
This will create a clean csv with the ROI coordinates and a shapefile in the same location as input file
Need to download and move jfreesvg (https://www.jfree.org/jfreesvg/) into Image-J/FIJI plugin folder
-
Open image and ROI manager in Image-J/FIGI
-
Opel File-> New Script and switch the language to python
-
Copy paste the svggenerator code or open file
-
Switch output to desired destination and name on line 34
path = "C:/Users/nicor/Downloads/testsvg3.svg"