forked from Borda/dataset-histology-landmarks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multiPointSet_export.ijm
34 lines (30 loc) · 924 Bytes
/
multiPointSet_export.ijm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* @file export_MultipointSet.ijm
* @title Marco for exporting multi-point set
* @author Jiri Borovec
* @date 13/06/2014
* @mail jiri.borovec@fel.cvut.cz
*
* @brief: This macro does export set of points from Multi-point tool
* into .csv and .txt files (the name is specified during exporting)
*/
// clean results
run("Clear Results");
// get all points
getSelectionCoordinates(xCoordinates, yCoordinates);
// chose name pattern for exporting
//fileName = File.openDialog("Select the file for export");
// just to have name of file...
f = File.open("");
File.close(f)
// remove this temporary file
res = File.delete(File.directory + File.name)
tmp = split(File.name,".");
fileName = File.directory + tmp[0];
// export as CSV file
for(i=0; i<lengthOf(xCoordinates); i++) {
setResult("X", i, xCoordinates[i]);
setResult("Y", i, yCoordinates[i]);
}
updateResults();
saveAs("Results", fileName+".csv");