External Email - Use Caution
Hello FreeSurfer Developers,
I'm attempting to refine pial surfaces with T2/FLAIR images as described here ( https://secure-web.cisco.com/1AH1BRBqXr5DfxhMfqvYMi7G1gSsW58-k5PUb3k7qBej25T...). For some of my subjects I get the following error during the mris_place_surface subprocess when I run recon-all:
error: MRIhistogramLabelRegion: constant image
error: MRIhistogramLabelRegion: constant image
Segmentation fault
The error occurs independent of whether I process T1 and T2 images together with -all or if I run only -autorecon3 with the T2 or FLAIR images added.
I've searched the list and while similar errors have been reported, no solutions have been proposed. Does anyone have any thoughts on how to troubleshoot this one?
1) FreeSurfer version: freesurfer-macOS-darwin_x86_64-7.4.1-20230614-7eb8460 2) Platform: macOS Sonoma 14.6.1 3) uname -a: Darwin MacBook-Air-M3 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8122 arm64 4) recon-all.log: relevant section below
Thank you! Thomas
mris_place_surface --adgws-in ../surf/autodet.gw.stats.lh.dat --seg aseg.presurf.mgz --wm wm.mgz --threads 8 --invol brain.finalsurfs.mgz --lh --i ../surf/lh.pial.T1 --o ../surf/lh.pial.T2 --pial --nsmooth 0 --rip-label ../label/lh.cortex+hipamyg.label --pin-medial-wall ../label/lh.cortex.label --white-surf ../surf/lh.white --aparc ../label/lh.aparc.annot --repulse-surf ../surf/lh.white --mmvol T2.mgz T2
Reading in input surface ../surf/lh.pial.T1
Not smoothing input surface
Area 280714 0.42434 0.32508 0.000178 6.1090
Corner 842142 60.00000 30.99319 0.049953 179.7466
Edge 421071 1.04711 0.48130 0.006015 7.4374
Hinge 421071 18.87838 25.11022 0.000011 179.9979
Reading white surface coordinates from ../surf/lh.white
Reading repulsion surface coordinates from ../surf/lh.white
Reading in aparc ../label/lh.aparc.annot
[DEBUG] CTABreadFromBinaryV2(): ct->nentries=36, num_entries_to_read=36
Reading in input volume brain.finalsurfs.mgz
Reading in seg volume aseg.presurf.mgz
Reading in wm volume wm.mgz
MRIclipBrightWM(): nthresh=15378, wmmin=5, clip=110
MRIfindBrightNonWM(): 1814 bright non-wm voxels segmented.
Masking bright non-wm for pial surface mid_gray = 67.5589
MRImask(): AllowDiffGeom = 1
MRImask(): AllowDiffGeom = 1
MRImask(): AllowDiffGeom = 1
Ripping frozen voxels
Ripping vertices not in label ../label/lh.cortex+hipamyg.label
MRISripNotLabel() ripped 6543/140359 vertices (133816 unripped)
INFO: rip surface needed but not specified, so using input surface
Ripping segs (eg, WMSA, BG, frozen)
Starting MRISripSegs() d = (-2 2 0.5) segnos: 247
MRISripSegs(): -2 2 0.5 ripped 0
Reading in multimodal volume T2.mgz
using multi modal weights
vertex 70180: xyz = (-39.3637,-26.8713,28.9107) oxyz = (-42.1603,-27.2597,31.4024) wxzy = (-42.1603,-27.2597,31.4024) pxyz = (-39.3637,-26.8713,28.9107)
CBVO Creating mask 140359
n_averages 4
Iteration 0 =========================================
n_averages=4, current_sigma=2
Computing pial target locations using multimodal (1)
starting MRIScomputePialTargetLocationsMultiModal()
max_outward_dist = 3, sample_dist = 0.1, pix_size = 1, whalf = 7
T2_min_inside = 110, T2_max_inside 300, T2_min_outside = 130, T2_max_outside 300
inside_peak_pct = 0.1, 0.01, outside_peak_pct = 0.5, 0.5
wm_weight = 3, nlabels=0, contrast_type=1
Changed 198177 aseg cortex voxels to 0
Creating lowres distance volumes t=0.0164299
Creating white distance volumes t=0.307498
(box.dx, box.dy, box.dz) = (132, 242, 326)
(region->dx, region->dy, region->dz) = (132, 242, 326)
(region->dx, region->dy, region->dz) = (132, 242, 326)
Creating pial distance volumes t=0.609579
(box.dx, box.dy, box.dz) = (144, 256, 336)
(region->dx, region->dy, region->dz) = (144, 256, 336)
(region->dx, region->dy, region->dz) = (144, 256, 336)
locating cortical regions not in interior range [110.0 --> 300.0], and not in exterior range [130.0 --> 300.0]
t = 0.984043
Starting loop over 140359 vertices
vno = 0, t = 0.984043
error: MRIhistogramLabelRegion: constant image
error: MRIhistogramLabelRegion: constant image
Segmentation fault
Hi Thomas
Can you check the input images? I’ve seen this happen when e.g. the skull stripping failed and the images are blank
Cheers Bruce
From: freesurfer-bounces@nmr.mgh.harvard.edu freesurfer-bounces@nmr.mgh.harvard.edu On Behalf Of Thomas Kaufmann Sent: Wednesday, October 9, 2024 1:37 PM To: Freesurfer@nmr.mgh.harvard.edu Subject: [Freesurfer] Error During T2/FLAIR Pial Surface Refinement
External Email - Use Caution Hello FreeSurfer Developers,
I'm attempting to refine pial surfaces with T2/FLAIR images as described here (MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://surfer.nmr.mgh.harvard.edu/fswiki/recon-all#UsingT2orFLAIRdatatoimpr...https://secure-web.cisco.com/1AH1BRBqXr5DfxhMfqvYMi7G1gSsW58-k5PUb3k7qBej25TzL4oJZblrUDWJjsLLjcoAP23YnnERxvXNWVp31VdS7Wz1q7Z9IGsbTfDYOtXS_IS2-NhyuSgcWRvjVEcIp8Ze5ad_mIfUdHi9dSOWXrSa2ApGwk2xa-45widx5O0YJ8QeYGP7QyiMbju7dhcO71PJoQVT13M2wFZLho8E4k-PiWY01aJ40WpQIqe-_MMmdpqn9-O7dJCNKFLcHeCc3vNvfCC-KBkMRhTOSH4vTaK_dzQspzQmlaXnfywC9zdXl9bVc-EaHeonBR_hFj6XSXZgCPXHCzOr4wFvMmGZaJg/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2Frecon-all%23UsingT2orFLAIRdatatoimprovepialsurfaces). For some of my subjects I get the following error during the mris_place_surface subprocess when I run recon-all:
error: MRIhistogramLabelRegion: constant image
error: MRIhistogramLabelRegion: constant image
Segmentation fault
The error occurs independent of whether I process T1 and T2 images together with -all or if I run only -autorecon3 with the T2 or FLAIR images added.
I've searched the list and while similar errors have been reported, no solutions have been proposed. Does anyone have any thoughts on how to troubleshoot this one?
1) FreeSurfer version: freesurfer-macOS-darwin_x86_64-7.4.1-20230614-7eb8460 2) Platform: macOS Sonoma 14.6.1 3) uname -a: Darwin MacBook-Air-M3 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8122 arm64 4) recon-all.log: relevant section below
Thank you! Thomas
mris_place_surface --adgws-in ../surf/autodet.gw.stats.lh.dathttp://surf/autodet.gw.stats.lh.dat --seg aseg.presurf.mgz --wm wm.mgz --threads 8 --invol brain.finalsurfs.mgz --lh --i ../surf/lh.pial.T1 --o ../surf/lh.pial.T2 --pial --nsmooth 0 --rip-label ../label/lh.cortex+hipamyg.label --pin-medial-wall ../label/lh.cortex.label --white-surf ../surf/lh.white --aparc ../label/lh.aparc.annot --repulse-surf ../surf/lh.white --mmvol T2.mgz T2
Reading in input surface ../surf/lh.pial.T1
Not smoothing input surface
Area 280714 0.42434 0.32508 0.000178 6.1090
Corner 842142 60.00000 30.99319 0.049953 179.7466
Edge 421071 1.04711 0.48130 0.006015 7.4374
Hinge 421071 18.87838 25.11022 0.000011 179.9979
Reading white surface coordinates from ../surf/lh.white
Reading repulsion surface coordinates from ../surf/lh.white
Reading in aparc ../label/lh.aparc.annot
[DEBUG] CTABreadFromBinaryV2(): ct->nentries=36, num_entries_to_read=36
Reading in input volume brain.finalsurfs.mgz
Reading in seg volume aseg.presurf.mgz
Reading in wm volume wm.mgz
MRIclipBrightWM(): nthresh=15378, wmmin=5, clip=110
MRIfindBrightNonWM(): 1814 bright non-wm voxels segmented.
Masking bright non-wm for pial surface mid_gray = 67.5589
MRImask(): AllowDiffGeom = 1
MRImask(): AllowDiffGeom = 1
MRImask(): AllowDiffGeom = 1
Ripping frozen voxels
Ripping vertices not in label ../label/lh.cortex+hipamyg.label
MRISripNotLabel() ripped 6543/140359 vertices (133816 unripped)
INFO: rip surface needed but not specified, so using input surface
Ripping segs (eg, WMSA, BG, frozen)
Starting MRISripSegs() d = (-2 2 0.5) segnos: 247
MRISripSegs(): -2 2 0.5 ripped 0
Reading in multimodal volume T2.mgz
using multi modal weights
vertex 70180: xyz = (-39.3637,-26.8713,28.9107) oxyz = (-42.1603,-27.2597,31.4024) wxzy = (-42.1603,-27.2597,31.4024) pxyz = (-39.3637,-26.8713,28.9107)
CBVO Creating mask 140359
n_averages 4
Iteration 0 =========================================
n_averages=4, current_sigma=2
Computing pial target locations using multimodal (1)
starting MRIScomputePialTargetLocationsMultiModal()
max_outward_dist = 3, sample_dist = 0.1, pix_size = 1, whalf = 7
T2_min_inside = 110, T2_max_inside 300, T2_min_outside = 130, T2_max_outside 300
inside_peak_pct = 0.1, 0.01, outside_peak_pct = 0.5, 0.5
wm_weight = 3, nlabels=0, contrast_type=1
Changed 198177 aseg cortex voxels to 0
Creating lowres distance volumes t=0.0164299
Creating white distance volumes t=0.307498
(region->dx, region->dy, region->dz) = (132, 242, 326)
(region->dx, region->dy, region->dz) = (132, 242, 326)
Creating pial distance volumes t=0.609579
(region->dx, region->dy, region->dz) = (144, 256, 336)
(region->dx, region->dy, region->dz) = (144, 256, 336)
locating cortical regions not in interior range [110.0 --> 300.0], and not in exterior range [130.0 --> 300.0]
t = 0.984043
Starting loop over 140359 vertices
vno = 0, t = 0.984043
error: MRIhistogramLabelRegion: constant image
error: MRIhistogramLabelRegion: constant image
Segmentation fault
External Email - Use Caution
Hi Bruce,
Thanks for your response. I figured it out, but it took a while to troubleshoot. There were a number of issues at play, some due to my stupidity and some that may suggest feature improvements.
1. The primary issue was that the FOV of the T2 images did not cover the entire brain volume, presumably since the primary purpose of the acquisition was to inspect the ventricles and/or subcortical structures. 2. In this scenario, the current stable release appears to exit with the "Segmentation fault" error as described in my original message. The current dev version spits out the "MRIhistogramLabelRegion: constant image" error and then just hangs indefinitely with 100% CPU load. 3. It may be a good idea to implement a check at the beginning of recon-all (if a T2 or FLAIR flag is passed) to verify if the image contains the entire brain volume. If it doesn't, an error message could be raised, so the user has an opportunity to correct their mistake. 4. Once I realized the issue, I exported a different image sequence that contained the full brain volume. I then ran -autorecon3 with the new T2 image, but the process still failed. This is where I got stuck for HOURS. The reason for the fault was that the transforms for the T2 image from the previous T2 image are retained in the mri/transforms folder. Therefore, the transforms of the incomplete images were applied to the complete images, resulting in cropping of the brain volume to the point where it was then incomplete again. This ultimately led to the same problem. The mri/orig/T2raw.mgz image was in good shape, but the mri/T2.mgz would already exhibit the cropping. 5. It may be a good idea to implement a check that verifies whether the T2 image has changed and if the existing transforms correspond to the specified T2 image, possibly via a checksum that is stored in the T2raw.auto.* http://secure-web.cisco.com/1Ca-6WOM9invcqQ6HF3AL5StykkRxAUrVlz_V5s9CLy8GOubgwdB9TcpdevemyJiWkkcR4P4Mp-7pY9cknQS2q9vslNih_ITBRt_Ax94GO74LurlNqX_EaXNWHqM30QSO_m12YU8QA1hJf7xhe_L-_oSwFYjD04a2KQ9bwzOMgXtqN15gh_JUi0QXWrrM1gQAsuT33ZOS4VhbBxiTIQZY0lA3_3JBFDKlwBFZzgzBLphzWgihSaFB7AA-5w7xLRAB4YOa3O1-m-fZtGP0ocgeQy8QkFv3v2CywRiWAtAI4OJpndqnP3iNuwfLB_fvU-mp/http%3A%2F%2Ft2raw.auto*/ and/or the T2raw.lta file. If it is determined that the input image has been updated and does not correspond to the transforms, the automatically generated transforms could be overwritten, thereby avoiding this issue. Or you could just recreate the automatic transforms regardless, since it seems that it would only be useful to retain transforms if they contain manual or external registration data. 6. If access to my images or logs would be helpful to you in the (potential) implementation of these suggestions, please let me know and I can upload them. I retained a copy of one of the problematic folders.
There were a few issues I (may or may not have) encountered along the way. Unfortunately, I didn't keep detailed enough notes throughout my troubleshooting process and don't have the (compute) time to recreate these potential problem areas. It may be a good idea to verify if the following items cause problems:
1. I originally called recon-all with the -T2 flag, but did not include -T2pial. I don't recall if this created an issue or if the -T2pial flag is implied when passing a T2 image. Presumably, this behavior would be analogous for FLAIR images. 2. I worked with the -parallel -openmp N flag for a while and then suspected that this may have been part of the problem. I believe to remember that when using the -parallel flag, all of my T2 processing failed, while only the ones with incomplete image volumes failed when not using the -parallel flag. 3. I have one image series with 512 x 512 x 170 px dimensions and a FOV of 260 degrees. FreeSurfer is not happy about that. I tried to use -hires and -cw256 (which appear to be mutually exclusive). I eventually ended up simply cropping it with MRIcroGL. It would be nice to have an automatic feature in FreeSurfer that crops excessive FOVs, so that this glitch doesn't occur and this manual step wouldn't be necessary. It would also be helpful to have the option in mri_convert to specify both the crop size and the center of a crop. Currently, these options appear to be mutually exclusive. 4. Most of my T1 images are 256 x 256 px in size, but the T2 images are all higher resolution, either 384 x 384 or 512 x 512, but with a very large slice thickness of more than 4 mm. I don't know if it's possible and how it's currently implemented, but it would be nice to be able to process the T1 images in their original resolution to save on compute time, but then interpolate and refine with the higher resolution T2 images during the -autorecon3 processes. It seems that this would combine the best of both worlds.
I hope this feedback is helpful.
Best, Thomas
*Thomas Kaufmann*, Dipl.-Phys., M.S. Pronouns: he/him/his Physicist | Audio Engineer | Disability Rights Activist
*Arizona State University | College of Health Solutions* Speech and Hearing Science (Auditory & Language Neuroscience) 975 S Myrtle Ave, Tempe, AZ 85281 | Lattie F. Coor Hall
Date: Wed, 9 Oct 2024 17:42:22 +0000 From: "Fischl, Bruce R.,PHD" BFISCHL@mgh.harvard.edu Subject: Re: [Freesurfer] Error During T2/FLAIR Pial Surface Refinement To: Freesurfer support list freesurfer@nmr.mgh.harvard.edu Message-ID: < DM5PR04MB126171D02F1F51DFFE60C096EF7F2@DM5PR04MB1261.namprd04.prod.outlook.com
Content-Type: text/plain; charset="utf-8"
Hi Thomas
Can you check the input images? I've seen this happen when e.g. the skull stripping failed and the images are blank
Cheers Bruce
On Wed, Oct 09, 2024 at 10:37 AM, Thomas Kaufmann tkaufmann@asu.edu wrote:
Hello FreeSurfer Developers,
I'm attempting to refine pial surfaces with T2/FLAIR images as described here (https://secure-web.cisco.com/1R4-8moFvOommy8UNXErfhOkkD_Bz4_9X2aJQpzXbNo9Dgw... recon-all#UsingT2orFLAIRdatatoimprovepialsurfaces). For some of my subjects I get the following error during the mris_place_surface subprocess when I run recon-all:
error: MRIhistogramLabelRegion: constant image error: MRIhistogramLabelRegion: constant image Segmentation faultThe error occurs independent of whether I process T1 and T2 images together with -all or if I run only -autorecon3 with the T2 or FLAIR images added.
I've searched the list and while similar errors have been reported, no solutions have been proposed. Does anyone have any thoughts on how to troubleshoot this one?
- FreeSurfer version:
freesurfer-macOS-darwin_x86_64-7.4.1-20230614-7eb8460 2) Platform: macOS Sonoma 14.6.1 3) uname -a: Darwin MacBook-Air-M3 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8122 arm64 4) recon-all.log: relevant section below
Thank you! Thomas
mris_place_surface --adgws-in ../surf/autodet.gw.stats.lh.dat --seg aseg.presurf.mgz --wm wm.mgz --threads 8 --invol brain.finalsurfs.mgz --lh --i ../surf/lh.pial.T1 --o ../surf/lh.pial.T2 --pial --nsmooth 0 --rip-label ../label/lh.cortex+hipamyg.label --pin-medial-wall ../label/lh.cortex.label --white-surf ../surf/lh.white --aparc ../label/lh.aparc.annot --repulse-surf ../surf/lh.white --mmvol T2.mgz T2
Reading in input surface ../surf/lh.pial.T1
Not smoothing input surface
Area 280714 0.42434 0.32508 0.000178 6.1090
Corner 842142 60.00000 30.99319 0.049953 179.7466
Edge 421071 1.04711 0.48130 0.006015 7.4374
Hinge 421071 18.87838 25.11022 0.000011 179.9979
Reading white surface coordinates from ../surf/lh.white
Reading repulsion surface coordinates from ../surf/lh.white
Reading in aparc ../label/lh.aparc.annot
[DEBUG] CTABreadFromBinaryV2(): ct->nentries=36, num_entries_to_read=36
Reading in input volume brain.finalsurfs.mgz
Reading in seg volume aseg.presurf.mgz
Reading in wm volume wm.mgz
MRIclipBrightWM(): nthresh=15378, wmmin=5, clip=110
MRIfindBrightNonWM(): 1814 bright non-wm voxels segmented.
Masking bright non-wm for pial surface mid_gray = 67.5589
MRImask(): AllowDiffGeom = 1
MRImask(): AllowDiffGeom = 1
MRImask(): AllowDiffGeom = 1
Ripping frozen voxels
Ripping vertices not in label ../label/lh.cortex+hipamyg.label
MRISripNotLabel() ripped 6543/140359 vertices (133816 unripped)
INFO: rip surface needed but not specified, so using input surface
Ripping segs (eg, WMSA, BG, frozen)
Starting MRISripSegs() d = (-2 2 0.5) segnos: 247
MRISripSegs(): -2 2 0.5 ripped 0
Reading in multimodal volume T2.mgz
using multi modal weights
vertex 70180: xyz = (-39.3637,-26.8713,28.9107) oxyz = (-42.1603,-27.2597,31.4024) wxzy = (-42.1603,-27.2597,31.4024) pxyz = (-39.3637,-26.8713,28.9107)
CBVO Creating mask 140359
n_averages 4
Iteration 0 =========================================
n_averages=4, current_sigma=2
Computing pial target locations using multimodal (1)
starting MRIScomputePialTargetLocationsMultiModal()
max_outward_dist = 3, sample_dist = 0.1, pix_size = 1, whalf = 7
T2_min_inside = 110, T2_max_inside 300, T2_min_outside = 130, T2_max_outside 300
inside_peak_pct = 0.1, 0.01, outside_peak_pct = 0.5, 0.5
wm_weight = 3, nlabels=0, contrast_type=1
Changed 198177 aseg cortex voxels to 0
Creating lowres distance volumes t=0.0164299
Creating white distance volumes t=0.307498
(box.dx, box.dy, box.dz) = (132, 242, 326)
(region->dx, region->dy, region->dz) = (132, 242, 326)
(region->dx, region->dy, region->dz) = (132, 242, 326)
Creating pial distance volumes t=0.609579
(box.dx, box.dy, box.dz) = (144, 256, 336)
(region->dx, region->dy, region->dz) = (144, 256, 336)
(region->dx, region->dy, region->dz) = (144, 256, 336)
locating cortical regions not in interior range [110.0 --> 300.0], and not in exterior range [130.0 --> 300.0]
t = 0.984043
Starting loop over 140359 vertices
vno = 0, t = 0.984043
error: MRIhistogramLabelRegion: constant image
error: MRIhistogramLabelRegion: constant image
Segmentation fault
External Email - Use Caution
2D thick slice images are not appropriate for surface generation.
Matt.
From: freesurfer-bounces@nmr.mgh.harvard.edu on behalf of Thomas Kaufmann tkaufmann@asu.edu Reply-To: Freesurfer support list Freesurfer@nmr.mgh.harvard.edu Date: Tuesday, October 29, 2024 at 1:46 PM To: "Freesurfer@nmr.mgh.harvard.edu" Freesurfer@nmr.mgh.harvard.edu Subject: Re: [Freesurfer] Error During T2/FLAIR Pial Surface Refinement
External Email - Use Caution Hi Bruce,
Thanks for your response. I figured it out, but it took a while to troubleshoot. There were a number of issues at play, some due to my stupidity and some that may suggest feature improvements.
1. The primary issue was that the FOV of the T2 images did not cover the entire brain volume, presumably since the primary purpose of the acquisition was to inspect the ventricles and/or subcortical structures. 2. In this scenario, the current stable release appears to exit with the "Segmentation fault" error as described in my original message. The current dev version spits out the "MRIhistogramLabelRegion: constant image" error and then just hangs indefinitely with 100% CPU load. 3. It may be a good idea to implement a check at the beginning of recon-all (if a T2 or FLAIR flag is passed) to verify if the image contains the entire brain volume. If it doesn't, an error message could be raised, so the user has an opportunity to correct their mistake. 4. Once I realized the issue, I exported a different image sequence that contained the full brain volume. I then ran -autorecon3 with the new T2 image, but the process still failed. This is where I got stuck for HOURS. The reason for the fault was that the transforms for the T2 image from the previous T2 image are retained in the mri/transforms folder. Therefore, the transforms of the incomplete images were applied to the complete images, resulting in cropping of the brain volume to the point where it was then incomplete again. This ultimately led to the same problem. The mri/orig/T2raw.mgz image was in good shape, but the mri/T2.mgz would already exhibit the cropping. 5. It may be a good idea to implement a check that verifies whether the T2 image has changed and if the existing transforms correspond to the specified T2 image, possibly via a checksum that is stored in the T2raw.auto.*http://secure-web.cisco.com/1Ugbor8M_qbO591hpcixVqmS15Q0yKIHKpn7JIkBtysKisraLoVRDUe8oJ60cWPp6ZlrPxJL5hQgy23Ku8P27ZUeeUPmEOkbn6hky2_IdyFWixGQNEhXnRAgapcXVQnp5wPXSuoK_7ox0Qd8ii010smmvkVhzrjW_J6gfjGVuFHIFQma-ViykT1J-I3FTZAjw2qtD0lrVbsch3c711ljPu7a3jTZXslmddKY4H1RLHPQa8-v8HQzxfeG4MyGlqMp1iDAh1HtjCAD0G3r-5D978cOjwxK2qHnCmgwRSN6HqL1vO94eFMb8yNqCgVhkGGYy/http%3A%2F%2Ft2raw.auto*/ and/or the T2raw.lta file. If it is determined that the input image has been updated and does not correspond to the transforms, the automatically generated transforms could be overwritten, thereby avoiding this issue. Or you could just recreate the automatic transforms regardless, since it seems that it would only be useful to retain transforms if they contain manual or external registration data. 6. If access to my images or logs would be helpful to you in the (potential) implementation of these suggestions, please let me know and I can upload them. I retained a copy of one of the problematic folders. There were a few issues I (may or may not have) encountered along the way. Unfortunately, I didn't keep detailed enough notes throughout my troubleshooting process and don't have the (compute) time to recreate these potential problem areas. It may be a good idea to verify if the following items cause problems:
1. I originally called recon-all with the -T2 flag, but did not include -T2pial. I don't recall if this created an issue or if the -T2pial flag is implied when passing a T2 image. Presumably, this behavior would be analogous for FLAIR images. 2. I worked with the -parallel -openmp N flag for a while and then suspected that this may have been part of the problem. I believe to remember that when using the -parallel flag, all of my T2 processing failed, while only the ones with incomplete image volumes failed when not using the -parallel flag. 3. I have one image series with 512 x 512 x 170 px dimensions and a FOV of 260 degrees. FreeSurfer is not happy about that. I tried to use -hires and -cw256 (which appear to be mutually exclusive). I eventually ended up simply cropping it with MRIcroGL. It would be nice to have an automatic feature in FreeSurfer that crops excessive FOVs, so that this glitch doesn't occur and this manual step wouldn't be necessary. It would also be helpful to have the option in mri_convert to specify both the crop size and the center of a crop. Currently, these options appear to be mutually exclusive. 4. Most of my T1 images are 256 x 256 px in size, but the T2 images are all higher resolution, either 384 x 384 or 512 x 512, but with a very large slice thickness of more than 4 mm. I don't know if it's possible and how it's currently implemented, but it would be nice to be able to process the T1 images in their original resolution to save on compute time, but then interpolate and refine with the higher resolution T2 images during the -autorecon3 processes. It seems that this would combine the best of both worlds. I hope this feedback is helpful.
Best, Thomas
Thomas Kaufmann, Dipl.-Phys., M.S. Pronouns: he/him/his Physicist | Audio Engineer | Disability Rights Activist
Arizona State University | College of Health Solutions Speech and Hearing Science (Auditory & Language Neuroscience) 975 S Myrtle Ave, Tempe, AZ 85281 | Lattie F. Coor Hall
Date: Wed, 9 Oct 2024 17:42:22 +0000 From: "Fischl, Bruce R.,PHD" <BFISCHL@mgh.harvard.edumailto:BFISCHL@mgh.harvard.edu> Subject: Re: [Freesurfer] Error During T2/FLAIR Pial Surface Refinement To: Freesurfer support list <freesurfer@nmr.mgh.harvard.edumailto:freesurfer@nmr.mgh.harvard.edu> Message-ID: <DM5PR04MB126171D02F1F51DFFE60C096EF7F2@DM5PR04MB1261.namprd04.prod.outlook.commailto:DM5PR04MB126171D02F1F51DFFE60C096EF7F2@DM5PR04MB1261.namprd04.prod.outlook.com>
Content-Type: text/plain; charset="utf-8"
Hi Thomas
Can you check the input images? I've seen this happen when e.g. the skull stripping failed and the images are blank
Cheers Bruce
On Wed, Oct 09, 2024 at 10:37 AM, Thomas Kaufmann <tkaufmann@asu.edumailto:tkaufmann@asu.edu> wrote: Hello FreeSurfer Developers,
I'm attempting to refine pial surfaces with T2/FLAIR images as described here (MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://secure-web.cisco.com/1J39ALQhygFPiMh9WmSBmlfq3h3mu1zj7og5MZo0Sr5U_g9...https://secure-web.cisco.com/1OTVNjfFXFRjH_U7iQmwUog14C_qZrincABsVuJbqN-l1LgWrnFONLAUqynitKkTNOnc3ze5D1UzuWLd9278WMrLxM4me2rzadu7nq5n8Dhl2A21TgBRG4VCOVlbqBx4HJIJxRWB97XYNTPPS8HsXp-lsZwXgvBeKGXLCRVJly2Vpyo4aZnKE6yDLHIU2X3rJGRiQpHqvSdhxQaxexq8vez3cQel9V2b_LVt81M6gqYS16yYOXhxeHR4jUyP8FdSLeVYKCTIzSD18jyfyAsRn98qjtvsixEUx6biHistVeRglE-llWPb4-cTa1-BIDcR__WAgAz69Y5VcuBr-xoA2DQ/https%3A%2F%2Fsurfer.nmr.mgh.harvard.edu%2Ffswiki%2Frecon-all%23UsingT2orFLAIRdatatoimprovepialsurfaces). For some of my subjects I get the following error during the mris_place_surface subprocess when I run recon-all:
error: MRIhistogramLabelRegion: constant image
error: MRIhistogramLabelRegion: constant image
Segmentation fault
The error occurs independent of whether I process T1 and T2 images together with -all or if I run only -autorecon3 with the T2 or FLAIR images added.
I've searched the list and while similar errors have been reported, no solutions have been proposed. Does anyone have any thoughts on how to troubleshoot this one?
1) FreeSurfer version: freesurfer-macOS-darwin_x86_64-7.4.1-20230614-7eb8460 2) Platform: macOS Sonoma 14.6.1 3) uname -a: Darwin MacBook-Air-M3 23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T8122 arm64 4) recon-all.log: relevant section below
Thank you! Thomas
mris_place_surface --adgws-in ../surf/autodet.gw.stats.lh.dathttp://surf/autodet.gw.stats.lh.dat --seg aseg.presurf.mgz --wm wm.mgz --threads 8 --invol brain.finalsurfs.mgz --lh --i ../surf/lh.pial.T1 --o ../surf/lh.pial.T2 --pial --nsmooth 0 --rip-label ../label/lh.cortex+hipamyg.label --pin-medial-wall ../label/lh.cortex.label --white-surf ../surf/lh.white --aparc ../label/lh.aparc.annot --repulse-surf ../surf/lh.white --mmvol T2.mgz T2
Reading in input surface ../surf/lh.pial.T1
Not smoothing input surface
Area 280714 0.42434 0.32508 0.000178 6.1090
Corner 842142 60.00000 30.99319 0.049953 179.7466
Edge 421071 1.04711 0.48130 0.006015 7.4374
Hinge 421071 18.87838 25.11022 0.000011 179.9979
Reading white surface coordinates from ../surf/lh.white
Reading repulsion surface coordinates from ../surf/lh.white
Reading in aparc ../label/lh.aparc.annot
[DEBUG] CTABreadFromBinaryV2(): ct->nentries=36, num_entries_to_read=36
Reading in input volume brain.finalsurfs.mgz
Reading in seg volume aseg.presurf.mgz
Reading in wm volume wm.mgz
MRIclipBrightWM(): nthresh=15378, wmmin=5, clip=110
MRIfindBrightNonWM(): 1814 bright non-wm voxels segmented.
Masking bright non-wm for pial surface mid_gray = 67.5589
MRImask(): AllowDiffGeom = 1
MRImask(): AllowDiffGeom = 1
MRImask(): AllowDiffGeom = 1
Ripping frozen voxels
Ripping vertices not in label ../label/lh.cortex+hipamyg.label
MRISripNotLabel() ripped 6543/140359 vertices (133816 unripped)
INFO: rip surface needed but not specified, so using input surface
Ripping segs (eg, WMSA, BG, frozen)
Starting MRISripSegs() d = (-2 2 0.5) segnos: 247
MRISripSegs(): -2 2 0.5 ripped 0
Reading in multimodal volume T2.mgz
using multi modal weights
vertex 70180: xyz = (-39.3637,-26.8713,28.9107) oxyz = (-42.1603,-27.2597,31.4024) wxzy = (-42.1603,-27.2597,31.4024) pxyz = (-39.3637,-26.8713,28.9107)
CBVO Creating mask 140359
n_averages 4
Iteration 0 =========================================
n_averages=4, current_sigma=2
Computing pial target locations using multimodal (1)
starting MRIScomputePialTargetLocationsMultiModal()
max_outward_dist = 3, sample_dist = 0.1, pix_size = 1, whalf = 7
T2_min_inside = 110, T2_max_inside 300, T2_min_outside = 130, T2_max_outside 300
inside_peak_pct = 0.1, 0.01, outside_peak_pct = 0.5, 0.5
wm_weight = 3, nlabels=0, contrast_type=1
Changed 198177 aseg cortex voxels to 0
Creating lowres distance volumes t=0.0164299
Creating white distance volumes t=0.307498
(box.dx, box.dy, box.dzhttp://secure-web.cisco.com/1CkCifJ2WGoiH6BkXRM1nTVsAyCSufHBMP7SkBU2G9SP8l5OOkA9m5Hr5U1r9Y47UGdky352DJjvpxsLUtfVmGyCft8-fIgj0do0VKzSWc1EbvenHhiSzXRtAD6MVwAETB-2ZFAAewg3QgwK9GB2HwJ2EVBTIRFX0tlRpkPFTk1NATE3aYcrrOH0vxnJgOELGnENIfiAUnw02IOnx261cn48i86XSIma17XHTnyy09PWwOPSJF74At1AZeTDG-1SS2d5yF_fGioGsrE1puXnoqMmeQcO1-x6DVGH0wZQ735ugyGH_HfBbcyXBMuakorPt/http%3A%2F%2Fbox.dz%2F) = (132, 242, 326)
(region->dx, region->dy, region->dz) = (132, 242, 326)
(region->dx, region->dy, region->dz) = (132, 242, 326)
Creating pial distance volumes t=0.609579
(box.dx, box.dy, box.dzhttp://secure-web.cisco.com/1CkCifJ2WGoiH6BkXRM1nTVsAyCSufHBMP7SkBU2G9SP8l5OOkA9m5Hr5U1r9Y47UGdky352DJjvpxsLUtfVmGyCft8-fIgj0do0VKzSWc1EbvenHhiSzXRtAD6MVwAETB-2ZFAAewg3QgwK9GB2HwJ2EVBTIRFX0tlRpkPFTk1NATE3aYcrrOH0vxnJgOELGnENIfiAUnw02IOnx261cn48i86XSIma17XHTnyy09PWwOPSJF74At1AZeTDG-1SS2d5yF_fGioGsrE1puXnoqMmeQcO1-x6DVGH0wZQ735ugyGH_HfBbcyXBMuakorPt/http%3A%2F%2Fbox.dz%2F) = (144, 256, 336)
(region->dx, region->dy, region->dz) = (144, 256, 336)
(region->dx, region->dy, region->dz) = (144, 256, 336)
locating cortical regions not in interior range [110.0 --> 300.0], and not in exterior range [130.0 --> 300.0]
t = 0.984043
Starting loop over 140359 vertices
vno = 0, t = 0.984043
error: MRIhistogramLabelRegion: constant image
error: MRIhistogramLabelRegion: constant image
Segmentation fault
________________________________ The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.
freesurfer@nmr.mgh.harvard.edu