Error Running BigWarp

Hi @bogovicj I have been experiencing some issues running a Big Warp image alignment between two MR images. Holding all procedures constant, a warped image is successfully produced ~25% of the time, and then in all of the other trials, I get a null-pointer exception:

 Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at bigwarp.BigWarpExporter.<init>(BigWarpExporter.java:95)
	at bigwarp.BigWarpRealExporter.<init>(BigWarpRealExporter.java:61)
	at bigwarp.BigWarpRealExporter.<init>(BigWarpRealExporter.java:80)
	at bigwarp.BigWarpExporter.getExporter(BigWarpExporter.java:599)
	at bigwarp.BigWarp.exportAsImagePlus(BigWarp.java:899)
	at bigwarp.BigWarp.exportAsImagePlus(BigWarp.java:789)
	at bigwarp.BigWarpActions$ExportImagePlusAction.actionPerformed(BigWarpActions.java:997)

(the error message continues…)

When I receive a null pointer exception, I can sometimes successfully get a warped image through the same exact image alignment if I close Fiji completely and restart. My current procedure:

  • open both the moving and target images as separate windows in Fiji (file --> import --> bigdataviewer --> select xml file)
  • open big warp (plugins --> bigdataviewer --> bigwarp --> select xml files and run plug-in)
  • place landmarks and create warped image (on landmark console: file --> export as image plus (for testing purposes, I am just leaving all the parameters as they are originally specified (resolution and field of view = target image) --> check virtual image plus --> click ok --> 25% of the time I successfully get a warped image, other 75% of the time I receive the above error message in my console

Any ideas/suggestions as to why this is occurring? Also, let me know if you would like anymore specifics of the data sets I am using.

Thanks,

Clara

1 Like

Hi Clara (@claraDu2022),

Thanks for reporting this problem.

Some follow up questions:

  1. Are you using the default transform type (thin plate spline)? Or did you change to something else?
  2. How big are the images?
  3. How many channels?
  4. Does this happen if you do not choose the virtual image plus option (maybe not possible if the images are huge)

What’s weird is that this seems to work some of the time for you… I’ll have to think about that.

As usual, an easy thing to try would be to grab the latest unreleased version, and see if that “magically” fixes things. I’ve made some assorted updates, but off the top of my head, I can’t think of something that could be related to this problem, so I’m not terribly optimistic.

Thanks again for writing,
John

1 Like

Hi John,

A few more details on the alignment I am trying to run:
The target and moving image file are both 2 KB. I am using the default transformation type. Also, I still run into the same problem if I do not select virtual image option. Each image only has one channel.

I will try out the update version and let you know if I have any more success!

Thanks,
Clara

1 Like

Hi John,

Just to give an update, I am no longer receiving that error message with the updated version of BigWarp! However, I am having issues in actually running a successful alignment between a 3D light sheet microscopy data set (moving image) and a diffusion weighted MR image (fixed image) (both of the images in the moving and fixed image windows are comprised of slices) As you can see, it attempts to perform the alignment but seems to only include two dimensions. I exported the warped image as an ImagePlus and had the field of view set to the moving image and resolution set to the target (but also tried many other combinations with out any success). Do you have any suggestions?

Thanks,

Clara

1 Like

Hi Clara (@claraDu2022),

Thanks for the update, happy to hear that!

Thanks for attaching that example. That does look weird. :confused:

Some ideas / thoughts below,
John

Follow up questions:

  • Does the alignment look okay in the bigwarp window? Or do things only look bad after you try to export?
  • Are the metadata (pixel spacing) set for your images? Specifically, it looks like they may not be…
    • That number of the top right of each image window is quite big for the lightsheet, and quite small for the dwi… that could be part of the issue.
    • If those metadata are not set, do you know the relative resolutions of your images?

Things to try:

For the export - can you try to leave the default values just to see what happens. :

  • Resolution: Target
  • Field of view: Target

I looks like the lightsheet image is much bigger (more pixels) than the dwi image, which makes sense.
In that case, I guess the default export options I suggest won’t make sense, since you’ll loose much of the resolution of the lightsheet image when you export.

The next thing I’d ask you to try would be:

  • Resolution: Moving
  • Field of view: Target

but that will only work if the pixel spacing is set, which it might not be.

Last thing, try:
The next thing I’d ask you to try would be:

  • Resolution: Specified
  • Field of view: Target
  • and put small numbers, like 0.01 in the x,y, and z Resolution fields…