David Shattuck

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 59 total)
  • Author
    Posts
  • in reply to: Cannot launch BrainSuite #3083
    David Shattuck
    Keymaster

    hi –

    Which version of Linux are you using?

    Can you try installing xinerama? On some platforms, this will fix the issue. Specifically, this fixed that issue on Ubuntu 16.04.

    sudo apt-get install -y libxcb-xinerama0

    For BrainSuite21a, the version of Matlab Runtime to use is 19b. Direct link: https://ssd.mathworks.com/supportfiles/downloads/R2019b/Release/3/deployment_files/installer/complete/glnxa64/MATLAB_Runtime_R2019b_Update_3_glnxa64.zip

    That isn’t causing the launch problem, but it is necessary to run some of the programs in BrainSuite.

    Let us know if that fixes the problem — if not we can get some further information and help you resolve this.

    thanks,
    David Shattuck

    in reply to: Cortical surface file conversion #2962
    David Shattuck
    Keymaster

    hi Gonzalo –

    The obj format used in BrainSuite is the MNI obj format, which was more widely used when we first developed BrainSuite.

    There is a way to get a Wavefront obj file from BrainSuite — if you save out a surface file using .wfo as the extension (I used wfo to represent WaveFront Obj) and then change the extension to .obj, you should be able to use it in programs that read Wavefront Obj files. I do this sometimes when I want to look at BrainSuite surfaces in Meshlab, and it works fine.

    You can also use a .stl extension, and the surface will be saved in STL format. Some of our users have used this to 3D print brain models made in BrainSuite.

    Just one note — both of these formats lose some of the information that BrainSuite uses in its different functions.

    Give it a try and let us know if it works for you.

    thanks,
    David Shattuck

    in reply to: bdp 18b source code link shows “not found” #2873
    David Shattuck
    Keymaster

    We have updated the source code links for 19b and 21a.

    thanks,
    David

    in reply to: Brainsuite crashes #2465
    David Shattuck
    Keymaster

    Better yet, can you provide an example subject/file ID for which this happens, and one of us can retrieve it from the ADNI database?

    in reply to: multiple bdp.sh commands in bash #1579
    David Shattuck
    Keymaster

    hi Dahyun –

    I don’t know why the semicolon isn’t working — the bash shell should be separating them into separate commands. It looks like you are only using one dash for the –nii flag, though. That could just be how our forum software translated it into text (it sometimes converts two dashes into a single emdash).

    In any case, for multiple subjects, I would typically use a for loop, like this:

    for SubjID in subj1 subj2 subj3; do
    	/Applications/BrainSuite18a/bdp/bdp.sh ${SubjID}.bfc.nii.gz --nii ${SubjID}.dwi.nii.gz -g ${SubjID}.bvec -b ${SubjID}.bval
    done

    For this, you only type the BDP command once, and you can add subjects to the for loop as you like. If you put this in a bash script, you can reuse it, something like:

    #!/bin/bash
    for SubjID in $@; do
    	/Applications/BrainSuite18a/bdp/bdp.sh ${SubjID}.bfc.nii.gz --nii ${SubjID}.dwi.nii.gz -g ${SubjID}.bvec -b ${SubjID}.bval
    done

    If you save that into a file, let’s say runBDPsubjs.sh, make it executable (using chmod +x runBDPsubjs.sh), then you can run it from the command line and pass it the subject IDs that you want to process, e.g.,

    runBDPsubjs.sh subj1 subj2 subj3

    It will run the commands you are trying to call. The $@ in the script contains the arguments that you passed to the script on the command line.

    Hope that helps.

    -David Shattuck

    in reply to: Curve Toolbox – Curve lenght #1524
    David Shattuck
    Keymaster

    hi Davide –

    We don’t have tools for that as part of the package, but if you are familiar with Matlab or C++ you can calculate these lengths pretty easily. If you save out the curves as a .dfc file, you can then read them with one of our file readers.

    You can find a Matlab function for reading the dfc file at the bottom of this page: http://brainsuite.org/formats/dfc/. (I think it is out

    function [curves,hdr,xml]=readdfc(filename)
    % READDFC reads a BrainSuite curve file.
    %
    % Author : David Shattuck, UCLA Brain Mapping Center
    fid=fopen(filename,'rb');
    if (fid<0)
        error(['unable to open file ' filename(:)']);
    end;
    hdr.magic=char(fread(fid,8,'char')');
    hdr.version=fread(fid,4,'uchar');
    hdr.headerSize=fread(fid,1,'uint32');
    hdr.dataStart=fread(fid,1,'uint32');
    hdr.metadataOffset=fread(fid,1,'int32');
    hdr.subjectDataOffset=fread(fid,1,'int32');
    hdr.nCurves=fread(fid,1,'int32');
    fseek(fid,hdr.metadataOffset,'bof');
    xml=char(fread(fid,hdr.dataStart-hdr.metadataOffset,'char')');
    curves=cell(hdr.nCurves,1);
    fseek(fid,hdr.dataStart,'bof');
    for i=1:hdr.nCurves;
        nPoints=fread(fid,1,'uint32');
        curves{i}=fread(fid,[3 nPoints],'float32')';
    end;
    fclose(fid);

    The curves are represented as a series of points in mm coordinates, so you can compute the path lengths very easily:

    function curvelength=curvelength(curve)
    curvelength=sum(sqrt(sum((curve(2:size(curve,1),:)-curve(1:size(curve,1)-1,:)).^2,2)));

    If you then read in a dfc, you can easily compute the length of any of the curves:

    curveset=readdfc('/Applications/BrainSuite18a/svreg/BCI-DNI_brain_atlas/BCI-DNI_brain.right.dfc');
    curvelength(curveset{1})
    

    Let us know if that does what you need.

    thanks,
    David Shattuck

    in reply to: combine and delete labels #970
    David Shattuck
    Keymaster

    One way you can do this is by using the LabelMask tool, which is in the Delineation Panel. If you press ‘Update List’ you will see all of the labels that are in the label volume. Select all of the ones you want to keep, then press Make Mask. If you then load the label file as the primary volume, you can then apply the mask to the volume (press ‘Apply’), and it will set all of the labels outside of the mask to 0. Save the primary volume as your new label volume, and then load it. It should only have the labels that you want.

    in reply to: Show one ROI only #919
    David Shattuck
    Keymaster

    Hi Leo –

    There isn’t a direct way, but you can easily create a mask from the label file. There is a tool in the Delineation Toolbox called “Label Mask Tool” (it’s at the bottom of the toolbox). If you first press “Update List” and then select your structure, you can press “Make Mask” to generate a mask volume for just that object (this will overwrite whatever is currently in the mask buffer). If you then save this mask out, you could load it in as a label. It would be set to 255 for your structure, and 0 for everywhere else.

    Will that give you what you need?

    thanks,
    David Shattuck

    in reply to: command line tools in BS 17a? #834
    David Shattuck
    Keymaster

    hi Tod –

    The binaries should have been included — I will repackage them later this week and upload a new version. We made a few final fixes right before release, and it looks like the code wasn’t recompiled before we packaged it.

    What version of the MSVC compiler are you using? The strideiterator file would only affect BSE, and it compiles under MSVC2013 (I think it fails on MSVC2015 or later).

    thanks,
    David

    in reply to: T1 file #696
    David Shattuck
    Keymaster

    What T1 file are you expecting to see? Are you trying to load your own image?

    We have tutorial data on our website. If you need data to use, you can start here:

    http://brainsuite.org/tutorials/

    perhaps with the Cortical Surface Extraction tutorial:

    http://brainsuite.org/tutorials/cseexcercise/

    thanks,
    David Shattuck

    David Shattuck
    Keymaster

    Hi Dayana –

    There is a download button at the top of the page. Go there, or use this link:

    Download

    and select the correct version for your operating system.

    thanks,
    David Shattuck

    in reply to: Command Line: Cerebrum Labeling #549
    David Shattuck
    Keymaster

    Hello –

    There is also cortical_extraction.sh, which can be run from bash on Mac or Linux. It sets all of the parameters to be the same as the GUI. If necessary, you can copy it and edit it if you need to make any changes. If you do edit it, then you will want to make sure that BrainSuiteDir is set to the installation path. If it is not set, then the script will try to find the files based on location of the script.

    thanks,
    David

    in reply to: BrainSuite GUI compile under debian Linux #548
    David Shattuck
    Keymaster

    Hi Gavin –

    I think you are probably using either the build I sent you in August, or perhaps the current linux release version. In any case, I believe I have resolved this issue with the latest release of BrainSuite (16a1). I think it has to do with differences between the gcc compiler and the clang compiler. Clang didn’t report any errors compiling the 16a source code, but gcc did. I have fixed the few places where there were problems, and I have successfully compiled the source code under gcc 4.8. We still use clang for the official releases.

    thanks,
    David

    in reply to: nii2nii.gz #450
    David Shattuck
    Keymaster

    Hi Christian –

    That’s great. One thing to make sure is that the order of the volumes is the same as is in your bvec/bval files. I’m not sure how best to do that. It might be safer to re-run dcm2nii on your original DICOM files, and make sure it outputs a 4D volume rather than individual 3D volumes. Are you using the latest version of dcm2nii?

    We do have our own programs for merging DWI files (see here: http://neuroimage.usc.edu/neuro/Resources/BDPAddons#mergeDWIs), which is useful when a set of diffusion data is acquired as two different acquisitions. However, this program expects to have one bvec and one bval file per nii file. I think this would be different from how your data currently are stored.

    thanks,
    David

    in reply to: nii2nii.gz #392
    David Shattuck
    Keymaster

    Hi Cristian –

    What tool did you use to convert them from DICOM to nifti? We typically use dcm2nii, which is included with MRIcron.

    thanks,
    David

Viewing 15 posts - 16 through 30 (of 59 total)