[Freesurfer] automating tkmedit
Hi everyone, I have written a simple script to automate the switching between the grayscale MRI image and the segmentation volume. All it is is a script that types "SetDisplayFlay 16 1" followed by a waiting period and then "SetDisplayFlag 16 0" followed by another waiting period and then loops. However, even though these commands work just fine when entered directly into Terminal, when I try to run the script I get an error saying essentially that the command or script itself can't be found. Of course, this is done while running tkmedit and so the title bar of my terminal reads "terminal - tkmedit.bin". When I type "echo $PATH" I get the respone that the PATH variable does not exist. Does anyone know how to make the command function in tkmedit? Thanks, Jared Price Center for Neurological Imaging Brigham and Women's Hospital Harvard Medical School 1249 Boylston Street Boston, MA 02115 617-525-6076 [EMAIL PROTECTED] The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance Help Line at 800-856-1983 and properly dispose of this information. ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] "psubmit: Command not found" error
Hi everybody, this is Jared over at the Brigham. Quick question for anyone who knows. I am trying to rebuild a subcortical atlas using the script rebuild_gca_atlas.csh. When calling the script I almost immediately get the error "psubmit: Command not found." I would like to get this working before I leave work today, so if anyone knows something about this error please let me know as soon as possible. ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] correction
Hi, this is Jared again at the Brigham. Quick correction. The error says "pbsubmit: Command not found." not "psubmit: Command not found." Thanks -Jared Jared Price Center for Neurological Imaging Brigham and Women's Hospital Harvard Medical School 1249 Boylston Street Boston, MA 02115 617-525-6076 [EMAIL PROTECTED] The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance Help Line at 800-856-1983 and properly dispose of this information. ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] automating tkmedit
Hi everybody, I had a quick question I was hoping someone could help me out with. I am trying to automate a few aspects of tkmedit but am running into some trouble in creating a shell script that can control it. Under normal circumstances, for example, the first line would be something like #!/bin/tcsh to tell the program to interpret commands through tcsh. However, I can't seem to get my scripts to recognize free surfer commands. For example if I have a line in the script like LoadSegmentationVolume volume:0 I get an error telling me that the command is not recognized. Does anyone know how to get scripts to correctly interpret tkmedit commands? Sorry if this is a novice question but I am just getting my feet wet in the whole scripting business. Thanks -Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] longitudinal processing
Hi everybody, 2 quick questions about longitudinal processing. 1) does the longitudinal processing even call the default gca atlas or does it use something else? 2) when processing say 7 time points should all longitudinal scans be processed from baseline or should time 3 be processed from time 2 etc. ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] volumetric analysis with different versions
Hi freesurfer gurus, I just noticed that version 4.1.0 is out. We have a relatively large amount of data already processed through various freesurfer versions such as 4.0.0 4.0.2 4.0.5. Is it valid to compare volumetric measurements from the subcortical segmentation file aseg.mgz across these versions? Must we do reruns? Cheers Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] shell choice
Hello freesurfer gurus, I noticed on the wiki that they recommend using tcsh when running freesurfer, although they say other shells can be used. Is there a significant advantage to using tcsh when running freesurfer? If I would rather use bash is there any significant reason not to? Warmest regards, -Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] missing information in volume headers
Dear freesurfer gurus, I noticed something unusual in some of our data today. When the command mri_info was run on some of the orig.mgz volumes the values listed for echo time and flip angle in some of the scans were 0.00, even though there was a listing for repetition time. What could have caused this? Could misinformation in the header cause variation in the freesurfer processing of that scan? Cheers, Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] quick follow-up
Will missing header info affect the rebuild_gca_atlas script? I noticed it didn't like it if echo time, repetition time etc. didn't match. Also, I assume there is no difference, or minimal enough difference to ignore, in the 001.mgz file when converted from say nifti or straight from dicom. Correct? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] fixing segmentation errors
Hello freesurfers! We have a large data set which has segmentation volumes that have been manually labeled. Along the way occasionally a voxel which should have been labeled as left-hemisphere was labeled with the corresponding right-hemisphere label. For example, there might be a few voxels in the right putamen labeled as left putamen. Is there a quick fix for this? Thanks, Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] mri_convert
Hi everybody, We have a set of patients who were all run using the same freesurfer version, except that some of the patients had their dicom files converted to 001.mgz with a somewhat older version of freesurfer. For example some of them went through that step with version 4.0 or 4.0.2 or 4.0.5 etc. Anyway, I was wondering, is there any reason why those 001.mgz files would not be usable? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] mri_convert
Hi everyone, I have a quick question but an important one. We are working on a 5 year study involving well over 1000 scans. Processing of these patients is primarily done using a cluster machine loaded with freesurfer version x86_64-redhat-linux-gnu-dev4-20080904. However, sometimes it is useful to be able to do certain preliminary steps of the processing locally in our lab which is full of Macs running the 4.0.5 version of freesurfer. Also, because of the long nature of the study in the past these computers have been loaded with 4.0.0 4.0.1 4.0.2 etc. Anyway, my question is that although all of the recon-all processing has been done on the cluster machine some scans have undergone mri_convert locally in the lab to create a 001.mgz file which is then fed to the cluster for further processing. Would there be any concern in this? I know the version of mri_convert for freesurfer version 4.0.5 is mri_convert 1.146.2.3 and the one on our cluster machine is 1.146.2.1, but I am not sure what the versions of mri_convert were that were used in 4.0.0 4.0.1 etc. Anyway, any reason for concern in having some variability only in the version invoked to create the 001.mgz file using mri_convert? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] mri_convert
correction to the previous message (which is below). The Macs in the local lab are now running Darwin-leopard-i686-stable 4.1.0 and the version of mri_convert on that seems to be 1.146.2.3 Hi everyone, I have a quick question but an important one. We are working on a 5 year study involving well over 1000 scans. Processing of these patients is primarily done using a cluster machine loaded with freesurfer version x86_64-redhat-linux-gnu-dev4-20080904. However, sometimes it is useful to be able to do certain preliminary steps of the processing locally in our lab which is full of Macs running the 4.0.5 version of freesurfer. Also, because of the long nature of the study in the past these computers have been loaded with 4.0.0 4.0.1 4.0.2 etc. Anyway, my question is that although all of the recon-all processing has been done on the cluster machine some scans have undergone mri_convert locally in the lab to create a 001.mgz file which is then fed to the cluster for further processing. Would there be any concern in this? I know the version of mri_convert for freesurfer version 4.0.5 is mri_convert 1.146.2.3 and the one on our cluster machine is 1.146.2.1, but I am not sure what the versions of mri_convert were that were used in 4.0.0 4.0.1 etc. Anyway, any reason for concern in having some variability only in the version invoked to create the 001.mgz file using mri_convert? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] volume changes
Dear gurus, when running mri_convert -rt nearest -ot nii -rl 001.mgz seg_edited.mgz seg_edited_axial.nii to reslice from coronal to axial space we are seeing some significant volume changes in the segmentation. Anyone know why or how to fix it. Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] freesurfer dice coefficient calculation
Hi freesurfer masters, Quick question on the way freesurfer calculates the dice coefficient. I am interested in getting an INTERsubject dice coefficient as a measure of similarity between 2 subjects. My question is, do I need to do an INTERsubject registration step before calculating the dice in freesurfer? In other words, does freesurfer do any kind of INTERsubject registration at the level of the aseg.mgz file? If it does not, when it calculates an intersubject dice coefficient, a low result could be due simply to poor alignment between scans and not poor anatomical correlation. If anyone has details please let me know. Cheers, Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] Brain segmentation stats
Gurus, Looking over some stats recently I noticed that if you add up all of the freesurfer stats for ventricles, namely the left and right lateral ventricles plus 3rd, 4th, and 5th ventricles and subtract that from the "Number of Brain Segmentation Voxels" stat, you do not get the value of the "Brain Segmentation Volume Without Ventricles" stat. Anyone know why? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] mean symmetric surface distance, Hausdorff distance etc..
Hi freesurfer masters, I was wondering if freesurfer had a way of comparing two segmentations for surface differences, something along the lines of a Hausdorff distance or the symmetric mean absolute surface distance Cheers, Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] follow-up to Hausdorff distance question
Hi all, I asked an earlier question about Hausdorff distance and was told there was a binary "mri_hausdorff_dist" that could calculate it, but I don't see it in the /Applications/freesurfer/bin directory. Is it elsewhere? Is it included with 4.4.0? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] Hausdorff distance
Hi gurus, I am evaluating two segmentation routines relative to a gold standard and would like to calculate the Hausdorff distance for each routine relative to the gold standard in the left and right Amygdala, Caudate, Putamen, and Hippocampus. I know that there are 3 main options to the mri_hausdorff_dist binary, namely -b (binarize input volumes with threshold ), -g (blur the input image with Gaussian ) and -max (compute the max of the min distances instead of the mean) but I am not quite sure how to use them to get the desired result. Does anyone know how best to use this tool to get structure-specific Hausdorff distances from 2 aseg.mgz volumes? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] modifying dicom headers
Hi all, I am looking for a powerful, robust tool for modifying dicom headers that can be called from the command-line and scripted. For example, I may need to alter the subject ID with which a dicom study was uploaded. We are managing a multi-site study and the various sites do not always uplaoded the images with the correct study-wide ID. Anyone know of a good one? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] frontal gray and white matter volumes
Hi all, I am interested in obtain a total gray matter volume and a total white matter volume specific to the frontal lobes. How can this be done in freesurfer? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] registration of gene expression images
Hi all, I have some images (2-d (single slice)) from mouse brains which show gene expression data from in-situ hybridization from several different mice. I would like to align each of these images with one another. Does anyone know of a really good tool for that sort of thing? Ideally I am looking to perform a 6-parameter transform of these images to bring them all into the same space. I know mri_robust_register does something similar for structural images of the human brain. Does anyone know of a good tool for this kind of thing? I thought someone in the freesurfer world might know. All the best and thanks for the help, Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] frontal gray matter and frontal white matter volumes
Hi freesurfer gurus, We are doing some freesurfer processing for a collaborating lab and the PI has asked us for a measure of gray matter volume and a measure of white matter volume, both of which need to be specific to just the frontal lobes. Does anyone know of a simple, and accurate, way of acquiring these measures from freesurfer? Thanks. Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] wiki page on how to read the stats files?
Hi all, Does anyone know if there is a detailed wiki page on how to interpret each of the different stats files. To this point I have primarily used the aseg.stats file but one of the PIs we are working with wants a measure of total gray matter and total white matter specific to the frontal lobes. In the wmparc.stats file there are some values that are labeled ctx... and some labled wm... My initial understanding was that wmparc.stats contains only stats for white matter. Are these measures that start with ctx... actual measures of the cortex, or measures of the white matter underneath that cortex? If the ctx... ones are measures of the cortex, couldn't we just select the gyri that we wanted to include as part of the "frontal lobes" and then sum all the selected ctx... values (in order to get the measure for total frontal gray) and similarly sum all the selected wm... measures (to get the measure for frontal white) all from the wmparc.stats file? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] qcache
Hi all, This should be a quick question to answer. I recently ran "recon-all -s -qcache" on a group of subjects after they had undergone initial processing. This was done using something of the form "for subjvar in `ls`; do recon-all -s $subjvar -qcache; done" (actually this was done on a grid computing system and the syntax was a bit different but this was the basic idea).Of course "fsaverage" was in that directory as well, because it needs to be there for the -qcache recon-all option to function properly. Anyway, the point is that the -qcache option was therefore run on "fsaverage" itself. I assume this is no big deal and that it will just put some unnecessary info files into the fsaverage directory. In other words I assume I can continue to use this fsaverage directory for futre -qcache runs and that there will just be some unnecessary files in the directory. Anyway, just wanted to be extra sure. Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] extracting single structures from aseg.mgz
Anyone know how to extract a single structure from aseg.mgz? In other words I assume it is possible to use the information in aseg.mgz to extract a single structure such that there is a new.mgz file that contains just the segmentation of the putamen or just of the caudate or whatever. Thanks. Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] follow-up
Thanks, I tried mri_extract_label and it works fine. However, it extracts the structure and gives it the label "nerve". Is there any way within mri_extract_label to keep the original labels (i.e. left putamen, right putamen, or whatever)? Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] manually segment with 001.mgz as main volume?
Hi all, I want to do a manual segmentation of the putamen in tkmedit, but rather than using brainmask.mgz as the main volume, I wanted to use 001.mgz. This is because the intensity normalization step can in certain cases brighten lighter areas of the putamen to 110. Anyway, when I load the 001.mgz volume it will allow me to load a segmentation on top of it, but it won't allow me to modify the segmentation. In other words, I load a segmentation volume and configure the segmentation brush but it won't respond whenever the 001.mgz file is loaded. Anyone know why, or know a workaround? Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] reply
I guess I am not entirely sure what the contrast properties of orig.mgz are. After looking at the recon-all DevTable I don't see anything that explicitly mentions any intensity normalization occurring before this point so I imagine it would work. I guess I will just ask you for your suggestion. For this particular task I would like the grayscale image to be as close to the original dicom images as possible with perhaps the one exception of reslicing. Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] reply
Doug, I tried mri_vol2vol --mov .../orig/001.mgz --targ ...orig/001.mgz --regheader -o ...This created a volume but the same issue remained. When I load a segmentation on top of the created volume, tkmedit won't let me alter the segmentation. If I use "new segmentation" as opposed to loading a previous segmentation (e.g. the aseg.mgz volume) then the segmentation works fine. Anyway, what I would like to do is put a volume as similar to the original dicoms as possible upon which a manual segmentation can be performed in tkmedit. Any other thoughts? Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] follow-up
...Also, I should mention that slice thickness in the MRI acquisition sequence was 1.3 mm so the native voxels are not 1x1x1. ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] moving 001.mgz to anatomical space
I see the mistake I made. Works well now. Thanks for the help. Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] registration to a template
Hi all, Does anyone have any recommendations for testing anatomical similarity between 2 different subjects? Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] mri_robust_register
Hi gurus, The output of mri_robust_register includes some instruction for checking the registration. In my case the ouput said I could check the registration by running "tkregister2 --mov 0110837_20090425/mri/001.anatomicalspace.mgz --targ 0311501_scan1_20061205/mri/001.anatomicalspace.mgz --lta 0110837_20090425/mri/transforms/robustreg.lta --reg 0110837_20090425/mri/transforms/robustreg.reg" However, when I run this I get the error that file 0110837_20090425/mri/transforms/robustreg.reg does not exist. Mri_robust_register appears to exit without error and creates the linear transform array file, but it did not create a file called robustreg.reg. Did something go wrong? ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Re: [Freesurfer] qdec.table.dat
Hi Matt, I believe the problem lies in how excel treats end of line characters (even Excel for Mac). You could use Open-office which will export to a more Unix-friendly format, or you could try using tr (a Unix command-line utility that could change the problematic end of line characters to Unix-compatible ones). Are you familiar with the Unix command-line tools? Try using "cat" to read the file and piping it to wc -l. Chances are you will have only one line. Let me know if you need further assistance. If there is nothing personal in the files, I could probably do it for you if you send me the file. Jared Matt Warner wrote: > Hi, > > I am trying to run qdec for group analysis of subcortical and cortical > volumes. I have all of my data in an excel sheet (subject ID, age, > gender, volumes of various structures) and am trying to convert this > into a file that will be able to be opened in qdec. I use a Mac, and > I have exported the sheet into text-edit and then resaved it as > "qdec.table.dat". This .dat file opens perfectly in text-edit. > However, when I go to load the table into qdec it gives me an error: > "error loading the data table" > > Is the dat file I created not compatible with qdec? If so, is there > another way in which I can transfer my data into a dat file? > > Thank you very much in advance for your help, > > Matt > > > ___ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] rebuild_gca_atlas.csh
Freesurfer gurus: When using rebuild_gca_atlas.csh it fails due to the fact that not all of the TRs TEs and FlipAngles are identical across all scans I am using for the atlas. Is there any major concern if we artificially change these values using mri_modify so that they are identical? Much thanks, Jared ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
[Freesurfer] follow-up to automation of TkMedit
Hi everyone. This is Jared over at Brigham and Women's. I have a follow-up question on the question I asked earlier about automating TkMedit such that it will switch between the segmentation overlay view and the gray-scale MRI view automatically. I was able to find a scripting option that I believe should allow me to switch the view from a command-line prompt. The command is listed in the TkMedit Guide. It is "SetDisplayFlag *flag value" *where flag is equal to one of various display options and value is equal to 0 or 1, presumably on or off. We use Mac OS X and run freesurfer through the Terminal command prompt using X11 as our graphical display program. Anyway, when I enter the command "SetDisplayFlag 15 1" which I believe should do the same thing as the keystroke control-g (turn on the segmentation overlay) my command prompt shows me no error messages, apparently accepts the command, but nothing changes on my display. The view remains exactly as it was before regardless of whether or not the segmentation volume was initially on or off when I ran the command.If anyone knows how to turn the segmentation overlay on or off from a command prompt or can correct any missteps that I may have taken please let me know. Thanks and all the best to each of you, Jared Price Center for Neurological Imaging Brigham and Women's Hospital Harvard Medical School 1249 Boylston Street Boston, MA 02115 617-525-6076 [EMAIL PROTECTED] ___ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer