Conversion of .csv to .roi for Fiji

I am trying to uniformly expand multiple polygonal ROI of microscopy images by changing the x,y coordinates of existing ROI. I was able to expand or increase the area of ROI by changing the x,y coordinates in .csv files (generated from .roi files). To upload these new ROI in ROI Manager, I need to convert .csv files to .roi format but I don’t know how to convert these .csv files to .roi. I greatly appreciate your help in solving this problem.
Best regards,

Hi @jhu,

The following example macro creates an ROI, makes a table from the x,y coordinates, saves the table as a .csv file, closes the table, opens the .csv file as a table and converts the table into an ROI.

  newImage("Untitled", "8-bit black", 500, 500, 1);
  Roi.getCoordinates(xpoints, ypoints);
  Table.create("ROI Points");
  Table.setColumn("X", xpoints);
  Table.setColumn("Y", ypoints);
  path = getDir("downloads")+"roipoints.csv";;
  close("ROI Points");;
  xpoints = Table.getColumn("X"); 
  ypoints = Table.getColumn("Y");
  makeSelection("polygon", xpoints, ypoints);

Thanks a lot Dr. Wayne. It’s working like magic.
Best regards,