External Email - Use Caution
Hi Randolph,
When you visualize the segmentation produced by samseg on top of its input image, does the segmentation look correct? If so, the problem is very likely not the affine registration code. (If the segmentation looks bad, please try samseg in the latest stable version of FreeSurfer, as we've improved the affine registration step quite a lot compared to earlier versions)
Hope this helps,
Koen
On Tue, Oct 5, 2021 at 4:07 PM daedalus39@aol.com wrote:
External Email - Use CautionDear 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 headerand 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 CautionWe 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 *MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be* https://secure-web.cisco.com/1xn9hiC30FRvHorB6GALrvqtmyUlkShKjiuPK4IslyUuViX... https://secure-web.cisco.com/1Zv7rNvEI4Kb-jCRvS8kJ-QkU8CZDN12WgnjTqh1UpLRFfReDLaz7h0xFLTPC8n1g6EOBhqngi2v61I4CpeLxNrrrN01fr8nX4qKmkDVaOG9TdRTGO8VFA6Er0c4TrWS5I4tsquZbMU2zs1p2vA9pE-uhd_W6edv2pIzOYQH_iiDO4qdyK8kh4Mq7ymQVYwwvMOgGHIwcEMzsFetpJEQ5SRh86M0Qf5jsFXQBKkytdlfc4hEwyGBlMbD0EawmkLGt6wUFjJFn3AJYLYE8kxY_3Q/https%3A%2F%2Fwww.mail-archive.com%2Ffreesurfer%40nmr.mgh.harvard.edu%2Fmsg24896.html
Freesurfer mailing listFreesurfer@nmr.mgh.harvard.edu*MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be* https://secure-web.cisco.com/1XCPHkA_ZbodmAuKrOh1A2c2kmZ4ZJkNmzlmyF5zjRXnbBe... https://secure-web.cisco.com/1MHKf5-elFV56eTlnYLZjebYVTNTz7KbL7wVP-AOHOzte8myVtxXOxbAJ8EnDhx8DlGzgqr7bYSIyp467jbm2KqtinDqiUysl1wEDScqRUvRY9-NnwE0dRMn_uhgCOi9jN_dZPqflioknj5Zjh_HsD8-nRUIqIrPysz42-Z9JEBrA-hYW01X6m9khpdLNkTpqdca9WQzHHfykf8EZf3-cXVpGwELzmtS-Y-oXZxdeZHA4SFqddt8D9wVH3D7sZMPcuqvPDdvYjFxx9Al4yFu28A/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu *MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be* https://secure-web.cisco.com/1XCPHkA_ZbodmAuKrOh1A2c2kmZ4ZJkNmzlmyF5zjRXnbBe... https://secure-web.cisco.com/1MHKf5-elFV56eTlnYLZjebYVTNTz7KbL7wVP-AOHOzte8myVtxXOxbAJ8EnDhx8DlGzgqr7bYSIyp467jbm2KqtinDqiUysl1wEDScqRUvRY9-NnwE0dRMn_uhgCOi9jN_dZPqflioknj5Zjh_HsD8-nRUIqIrPysz42-Z9JEBrA-hYW01X6m9khpdLNkTpqdca9WQzHHfykf8EZf3-cXVpGwELzmtS-Y-oXZxdeZHA4SFqddt8D9wVH3D7sZMPcuqvPDdvYjFxx9Al4yFu28A/https%3A%2F%2Fmail.nmr.mgh.harvard.edu%2Fmailman%2Flistinfo%2Ffreesurfer 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://secure-web.cisco.com/1JxKza8UfSgFv_A7fx18Bv8tYTbhwToR8FCtoveB4v9sKPYM... http://secure-web.cisco.com/1p2xZV6BIdVk3zPZxTiyjFDUC3e1eLhdh2M9mbWTNHYZawnAKkVQPsQ82LfNQcoUjEnq5Ans_37vPrfHQqGGCfNh6kq1vJ1w12cqPW15jZ1yO343G7-ED7Z0rCLinRlF5LapxP8RBRW58892sxGwZNCp9lQwEltmOE_QKoUEpHIyEP1jl2esMhbahPCUd6DiFfeUcL-8WlbiLCT5xzfr328xt8LGPhlD5tSu7KNKivSDhxX8Urb2y2abQZoCxGiTlzDuYf0BDuZEzTJRNUeUrRQ/http%3A%2F%2Fwww.massgeneralbrigham.org%2Fcomplianceline. 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. _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://secure-web.cisco.com/1XCPHkA_ZbodmAuKrOh1A2c2kmZ4ZJkNmzlmyF5zjRXnbBe...