How to transform points locations (csv) with bigwarp

Hi, I dont have programming background. I would like to ask i have landmark correspondences for BigWarp
and I would like to have transformation parameters to calculate new coordinates for given pixel positions. I have find out the thin plate spline has the best output. I suppose i have initial coordinates x,y then i need transformations dx,dy so i can calculate new positions x+dx and y+dy.


This text will be hidden
foto is 6240x4160px
landmarks moje.csv (94.5 KB)

Hi @Bjj,

Welcome to the forum.

This script is probably the easiest way to apply the bigwarp transform to arbitrary points.

There’s more information on this wiki page, in the section called “Warp points in a csv file”. If you still have questions after reading that, please write back.


I have already tried, with error

ERROR] jdk.nashorn.internal.runtime.ParserException: Scripts/Bwarpcsv.js:13:0 Expected an operand but found import
import [](*;
at jdk.nashorn.internal.parser.AbstractParser.error(
at jdk.nashorn.internal.parser.AbstractParser.error(

I don’t know if the structure of landmarks is the same as BigWarp or different

and scripts wants also csv output file so I don’t know what structure shall be input csv and output csv
I tried this structure

Hi @Bjj,

It looks like you tried running that script as javascript?

which is not right. Make sure the file extension is .groovy.

Learn about the fiji script editor here:

If you use that, copy the stuff in that file and make sure you select Groovy under the Language menu.


OK, thank you. But now the error is therefore I ask what is the data structure of landmarks, csv input and csv output. Is it right what I have written before?

[ERROR] java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
What does it mean the sentence?
Csv files storing bigwarp landmarks will not work as input to this script.

Correct. Your csv should be “plain”, more like this (which you tried before):

Except make sure you have the same number of columns as the dimensionality of your images. It looks like you used 2d images*, so your csv should have only two columns.


*Since the Bigwarp csv you posted has only 4 numeric columns at the end (moving-x, moving-y, target-x, target-y)

I used this structure of landmarks. I have 1678 landmarks pairs.
and this structure of input csv this can have e.g. 200 different coordinates

[ERROR] java.lang.NullPointerException: Cannot invoke method apply() on null object

The landmarks have to be a file exported by bigwarp. It has to look something like this:

~1600 is a lot of landmarks by the way, did you click all of these yourself?

Or is the issue that you want to use landmark pairs generated in some other way? If this is the case, please say so and I can make a script to do this.

Please be as clear as you can about describing what you’re doing. The more detail you give, the more likely we are to be able to help quickly.


Hi John, I already have landmark pairs and I want to transform, using thin plate spline initial x,y, coordinates to new coordinates based on these landmark pairs. I have not used BigWarp to obtain these landmarks, I prepared own landmarks and modified them to BigWarp structure csv. I used these landmarks in BigWarp to transform the picture of 26 Mpx which took 6.5 minute. And this worked. But now I want only transform coordinates without transforming pictures based on my own landmarks.

Still, there is an error
java.nio.file.AccessDeniedException: C:\Users\


I’ve done something that may help you. ’

The script below takes two csvs - one for moving and one for target points, and creates a bigwarp landmark csv file.


p.s. Read more about scripting in fiji here.