The current supported version, 7.28, has just had an update. You can download the sources from the usual place, and there's an updated Windows binary too. There are a number of bugfixes and speedups, but the interesting thing is a new system for nip2 which makes workspaces saved on one machine work on another.
I've been doing some work recently where I've had to make complicated workspaces that function correctly across Linux and Windows installs and it's been very frustrating. This new system should make all that far easier.
Background
It used to be quite hard to make a workspace which would work everywhere. The difficulty was that when you loaded an image into a workspace, it would put the full filename of the image in there, including the name of the directory containing the image.
When you moved the workspace to another machine, unless everything happened to end up in exactly the same spot, the images might not load. nip2 used to keep a list of recent directories and also search for images there, but the system was not very reliable unless you edited the workspace file by hand to remove the directory names.
Detecting relocation
In the new system, during workspace save, nip2 stores the full path of the save filename inside the workspace. When a workspace is loaded, nip2 compares the load path and the save path, works out how the workspace has moved since it was saved, and rewrites all paths inside the workspace to take account of this.
Environment variables
This will only work for images which are stored in the same directory tree as the workspace. If a workspace references a file stored outside this area (for example, an ICC profile kept in the nip2 install area), it will not be rewritten. nip2 has a second strategy for handling this case: nip2 has a set of environment variables it keeps which track important related directories. These include VIPSHOME, HOME (the user's home directory), TMPDIR (the nip2 temporary area) and a few others. nip2 now rewrites all filenames to use these environment variables where it can. When a workspace is opened on another machine, the new values of these variables are substituted and the workspace should be correct.
If you load an old workspace into the new nip2 and save again, it'll be updated to the new system for referencing external files. These new workspaces will also load into old versions of nip2, so there should be no downside.
That's interesting, but I did not have that problem in Linux. I do use nip2 on two laptops, and use the same workspace to do repetative tasks (e.g., cropping and building a histograms). The thing is, however, that on both laptops I have the same path to images like ~/matlab/research/lena.png
ReplyDeleteI mean, the path ~/matlab/research/ is the same, althougt absolute path is different (/home/dot/matlab vs /home/think/matlab). Anyway, I did not know how nip2 stores the workspaces. That's by the way a good thing when the author of the program writes a blog - nobody knows the programm better! :-)
You're right, it wasn't too bad if you stuck to one platform, since things were mostly in the same place.
DeleteI've been doing some work where workspaces have to work reliably between linux and Windows and it was very difficult, argh. Hence this update!