External Email - Use Caution        

Dear Doug,

The "template_coreg.mgz" image is also upside-down and rotated 90 degrees (X).  Can you suggest how I might troubleshoot the initial registration? 

I can send a logfile if it helps (not sure if I attach the textfile it will pass through your email filter)

I saw a section in "Samseg.py" concerning SAMSEG_LEGACY_REGISTRATION but I'm not sure if this is relevant.

Sincerely,
Randolph Andrews


 # =======================================================================================
        #
        # Preprocessing (reading and masking of data)
        #
        # =======================================================================================

        # Read the image data from disk and crop

        # Historically, the template was resaved with a transformed header and the image-to-image transform
        # was later extracted by comparing the input image and coregistered template transforms, but shear
        # cannot be saved through an ITK image, so a better method is to pass the image-to-image transform matrix
        # directly to samseg. If the SAMSEG_LEGACY_REGISTRATION env var is set, this old method is enabled
        if os.environ.get('SAMSEG_LEGACY_REGISTRATION') is not None:
            print('INFO: using legacy (broken) registration option')
            transformedTemplateFileName = os.path.join(self.savePath, 'template_coregistered_legacy.nii')
            self.imageBuffers, self.transform, self.voxelSpacing, self.cropping = readCroppedImagesLegacy(self.imageFileNames, transformedTemplateFileName)
        else:
            self.imageBuffers, self.transform, self.voxelSpacing, self.cropping = readCroppedImages(
                self.imageFileNames,
                os.path.join(self.atlasDir, 'template.nii'),
                self.imageToImageTransformMatrix
            )



-----Original Message-----
From: Douglas N. Greve <dgreve@mgh.harvard.edu>
To: freesurfer@nmr.mgh.harvard.edu
Sent: Sun, Oct 3, 2021 8:04 am
Subject: Re: [Freesurfer] SAMSEG output orientation not the same as input images

Can you compare the template_coreg.mgz to the input image; they should be mostly aligned. If not, then the initial registration failed.


On 9/28/2021 2:38 PM, daedalus39@aol.com wrote:
        External Email - Use Caution        
We have recently installed FS-7.1 and have tested a few “ADNI” images with SAMSEG.  The process runs to completion, but the output (seg.mgz) appears upside-down and rotated about 90 about the X-axis.  We are passing seg.mgz through BrainStorm to create NiFTI images.  We do not believe that this is a BrainStorm issue inasmuch as the same images run through recon-all (fully separate proc) yield output images in the same orientation as the original images.  I found a thread from 2012 with a similar output orientation issue, but the I did not see a response that resolved this.

Any solution or insight would be greatly appreciated

Sincerely,
Randolph Andrews

 
(PS. listserv item from 2012)
Re: [Freesurfer] integrating FSL and Freesurfer
Chris Filo Gorgolewski Tue, 09 Oct 2012 01:03:57 -0700

_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer

_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be http://www.massgeneralbrigham.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.
Please note that this e-mail is not secure (encrypted).  If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately.  Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.