Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion mrAnatomy/Segment/mrAnatExtractBrain.m
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
end
end

% JB on 19/08/2016: on some systems, calling a system command outputs some text when running .bashrc or .cshrc
remain=bet; % so we remove any additional starting lines
while ~isempty(remain) %if there are more than 2 lines
[bet,remain]=strtok(remain,sprintf('\n')); % isolate first line
end

bet = strtrim(bet); % The name of the bet funciton on the system

% Set temporary file names for the out file and bet script. These will be
Expand Down Expand Up @@ -100,7 +106,7 @@
betOut = tempname;
betCmd = [bet ' ' out ' ' betOut ' -mnf ' num2str(betLevel(ii))];
fid = fopen(betScript,'wt');
fprintf(fid,'#!/bin/bash\nexport FSLOUTPUTTYPE=NIFTI_GZ\n%s\n',betCmd);
fprintf(fid,'#!/bin/bash\nFSLOUTPUTTYPE=NIFTI_GZ\n%s\n',betCmd); %JB on 19/08/2016: should not export FSLOUTPUTTYPE: it has to equal NIFTI_GZ inside the script
fclose(fid);
unix([bash ' ' betScript]);
betOut = [betOut '_mask.nii.gz'];
Expand Down