uniGradICON icon indicating copy to clipboard operation
uniGradICON copied to clipboard

first try failed.

Open devhliu opened this issue 11 months ago • 3 comments

t1w This is my first try.... it seems the regularization is still a big issue....

devhliu avatar Mar 16 '24 17:03 devhliu

Looks like this is a multi-modal test case. Can you run a case without instance optimization? If this works then it is possible that switching the similarity measure from 1-LNCC to 1-LNCC^2 for instance optimization could fix the issue.

marcniethammer avatar Mar 16 '24 18:03 marcniethammer

Hi! As much as I bragged about getting spacing and orientation correct, it looks like I messed it up somewhere. Could you post the output of this program for the fixed and moving images?

import argparse
parser = argparse.ArgumentParser(description='info of a volume')
parser.add_argument('-w', action='store_true')
parser.add_argument('volumes', metavar='Volume', nargs='+',
                   help='volumes to investigate')
import SimpleITK as sitk
args = parser.parse_args()
for v in args.volumes:
    reader = sitk.ImageFileReader()

    reader.SetFileName(v)
    
    
    reader.LoadPrivateTagsOn()

    reader.ReadImageInformation()
    print("=" * 30)
    print(v)
    if(args.w):
        for k in reader.GetMetaDataKeys():
            v = reader.GetMetaData(k)
            print("({0}) = = \"{1}\"".format(k, v))

    print("Image Size: {0}".format(reader.GetSize()))
    print("Image PixelType: {0}"
          .format(sitk.GetPixelIDValueAsString(reader.GetPixelID())))
    print("Image Spacing: {0}".format(reader.GetSpacing()))
    

HastingsGreer avatar Mar 16 '24 18:03 HastingsGreer

Our approach handles differences in spacing well, but not yet differences in axis orientation. The current best workaround when images have different axis orientations ( itk.Image.GetDirection() ) is to resample one image to the coordinate system of the other before registering. We hope to automate this process soon, but for now it can be handled with a call to unigradicon-warp to resample the image before calling unigradicon-register.

I've documented the issue and the fix in this notebook:

https://colab.research.google.com/drive/1CmbTUneDRAlOkjUjcOm8f9ebSOarZhT3?usp=sharing

HastingsGreer avatar Mar 16 '24 21:03 HastingsGreer