loadNrrdStructure.m File Reference

Functions

function otherwise it will not
work makes Assumes but needs
to be compiled manually on
your machine 
cd ('../../../../Slicer3-lib/teem/src/matlab')
 elseif (foundKeyword('DWMRI_GRADIENT_', cs))[iGNr
 elseif (foundKeyword('DWMRI_B-VALUE', cs)) headerInfo.bvalue
 elseif (foundKeyword('MODALITY', cs)) headerInfo.modality
 elseif (foundKeyword('MEASUREMENT FRAME:', cs)) iMF
 elseif (foundKeyword('SPACE ORIGIN:', cs)) iSO
 elseif (foundKeyword('SPACE UNITS:', cs)) headerInfo.spaceunits
 elseif (foundKeyword('CENTERINGS:', cs)) headerInfo.centerings
 elseif (foundKeyword('KINDS:', cs)) headerInfo.kinds
 elseif (foundKeyword('THICKNESSES:', cs)) sThicknesses
 elseif (foundKeyword('SIZES:', cs)) iSizes
end elseif (foundKeyword('SPACE DIRECTIONS:', cs))%iSD
 elseif (foundKeyword('SPACE:', cs)) headerInfo.space
 elseif (foundKeyword('DIMENSION:', cs)) headerInfo.dimension
 elseif (foundKeyword('DATA FILE:', cs))%headerInfo.datafile
 elseif (foundKeyword('ENCODING:', cs)) headerInfo.encoding
 elseif (foundKeyword('ENDIAN:', cs)) headerInfo.endian
 elseif (foundKeyword('TYPE:', cs)) headerInfo.type
if(csTmp(1)~='#'&~strcmp(cs(1:4),'NRRD'))
fprintf('Warning end end end 
fclose (fidr)
else fprintf ('Warning:File is not RAS, make sure subsequent matlab processing is consistent!\n')
headerInfo gradients (iGNr+1,:)
return end if (strcmp(csU(1:lenKeyword), keyWordU)) fk
 if (len< lenKeyword) fk=0 = iSD
else if (~iLastWasDelimiter) indxList
 if (numDelimiters >=1) sl
 if (isempty(assgnLoc)) dwiGradient = []
only implemented for RAS if (iLocation >0) iIsRas
 if (foundKeyword( 'CONTENT:', cs)) headerInfo.content
 iMF (3) iMF(6) iMF(9)]
 iMF (2) iMF(5) iMF(8)
 iSD (3) iSD(6) iSD(9)]
 iSD (2) iSD(5) iSD(8)
 while (iEnd >1 &strList(iEnd)==delim) iEnd
 while (iStart< len &strList(iStart)==delim) iStart
 while (~feof(fidr)) cs

Variables

TODO __pad0__
find where the assignment is assgnLoc = strfind( st, ':=' )
headerInfo centerings = [{'?^} {'cell'} {'cell'} {'cell'}]
else let s see if we are
dealing with a comment 
csTmp = removeExcessDelimiters( cs, ' ' )
 csU = upper( cs )
headerInfo data = '?^
 delimiterIndices = strfind(strList,' ')
headerInfo dimension = '?^
in case of a tensor volume
there are 
dimensions
 dwiGradient = extractGradient( cs(length('DWMRI_GRADIENT_')+1:end ) )
headerInfo encoding = '?^
headerInfo endian = '?^
 fidr = fileparts( nhdrFileName ) fopen( nhdrFileName, 'r' )
return function fk
return function [iGNr, dwiGradient]
default header
function headerInfo
end iEnd = len
for iI
end iLastWasDelimiter = 0
 iLocation = strfind( csU(length('SPACE:')+1:end ), 'RIGHT-ANTERIOR-SUPERIOR')
end indxList = []
return function iNrs
 iSD = extractNumbersWithout( space_dir_tmp, {'(',')',','} )
 iStart = 1
 iThicknesses = []
 keyWordU = upper( keyWord )
tensor has to have headerInfo kinds
end return function kvs
 len = length( strList )
 lenKeyword = length( keyWord )
 lenThicknesses = length( sThicknesses )
decided that the none is not
needed in 
matlab
headerInfo measurementframe = [NaN NaN NaN
NaN NaN NaN
function otherwise it will not
work makes Assumes 
nrrdStructure
 numDelimiters = length(delimiterIndices)
these fields are optional
if(fidr==-1) fprintf('ABORT return
headerInfo sizes = '?^
end return function sl
headerInfo space = '?^
in case of a tensor volume
there are but only of them are
in space 
space_dir_tmp = strrep( cs(length('SPACE DIRECTIONS:')+1:end), 'none', 'NaN' )
headerInfo scalar data is
expected to have values
headerInfo 
spacedirections = [NaN NaN NaN
headerInfo spaceorigin = [NaN NaN NaN]
headerInfo thicknesses = iThicknesses
headerInfo type = '?^

Function Documentation

function otherwise it will not work makes Assumes but needs to be compiled manually on your machine cd ( '../../../../Slicer3-lib/teem/src/matlab  ) 
Type Constraints
elseif ( foundKeyword('DWMRI_GRADIENT_', cs  ) 
elseif ( foundKeyword('DWMRI_B-VALUE', cs  ) 
elseif ( foundKeyword('MODALITY', cs  ) 
elseif ( foundKeyword('MEASUREMENT FRAME:', cs  ) 
elseif ( foundKeyword('SPACE ORIGIN:', cs  ) 
elseif ( foundKeyword('SPACE UNITS:', cs  ) 
elseif ( foundKeyword('CENTERINGS:', cs  ) 
elseif ( foundKeyword('KINDS:', cs  ) 
elseif ( foundKeyword('THICKNESSES:', cs  ) 
elseif ( foundKeyword('SIZES:', cs  ) 
end elseif ( foundKeyword('SPACE DIRECTIONS:', cs  ) 
elseif ( foundKeyword('SPACE:', cs  ) 
elseif ( foundKeyword('DIMENSION:', cs  ) 
elseif ( foundKeyword('DATA FILE:', cs  ) 
elseif ( foundKeyword('ENCODING:', cs  ) 
elseif ( foundKeyword('ENDIAN:', cs  ) 
elseif ( foundKeyword('TYPE:', cs  ) 
if ( csTmp(1)~='#' & ~strcmp(cs(1:4),'NRRD') ) fprintf('Warning end end end fclose ( fidr   ) 
else fprintf ( 'Warning:File is not  RAS,
make sure subsequent matlab processing is consistent!\n'   
)
headerInfo gradients ( iGNr+  1,
 
)
return end if ( strcmp(csU(1:lenKeyword), keyWordU  ) 
if (  )  = iSD [pure virtual]
else if ( iLastWasDelimiter  ) 
end if ( numDelimiters >=  1  ) 

References numDelimiters.

if ( isempty(assgnLoc  )  = []
only implemented for RAS if ( iLocation  ,
 
)
if ( foundKeyword( 'CONTENT:', cs  ) 
iMF (  ) 
iMF (  ) 
iSD (  ) 
iSD (  ) 
while ( iEnd  ,
1 &  strListiEnd = =delim 
)
while (  ) 
while ( feoffidr  ) 

Variable Documentation

TODO __pad0__
find where the assignment is assgnLoc = strfind( st, ':=' )
headerInfo centerings = [{'?^} {'cell'} {'cell'} {'cell'}]
else let s see if we are dealing with a comment csTmp = removeExcessDelimiters( cs, ' ' )
csU = upper( cs )

Referenced by qMRMLNodeComboBox::activateExtraItem(), CompareTwoVolumes(), vtkSlicerViewControlGUI::ConfigureNavigationWidgetRender(), MatrixRowCol::Data(), MeshContourEvolver::entry_main(), vtkImageGraph::ExecuteData(), vtkTensorMask::ExecuteData(), vtkTeemEstimateDiffusionTensor::ExecuteData(), vtkNRRDReader::ExecuteData(), vtkImageSetTensorComponents::ExecuteData(), vtkITKTimeSeriesDatabase::ExecuteData(), vtkITKArchetypeImageSeriesVectorReaderSeries::ExecuteData(), vtkITKArchetypeImageSeriesVectorReaderFile::ExecuteData(), vtkITKArchetypeImageSeriesScalarReader::ExecuteData(), vtkImageRectangularSource::ExecuteData(), vtkImageCurveRegion::ExecuteDataGauss(), vtkImageCurveRegion::ExecuteDataReadFile(), vtkImageRectangularSource::ExecuteInformation(), qSlicermiAnnotationModuleImageUtil::fromImageData(), vtkSlicerFixedPointVolumeRayCastCompositeShadeHelper::GenerateImage(), vtkSlicerFixedPointVolumeRayCastCompositeGOShadeHelper::GenerateImage(), vtkSlicerFixedPointVolumeRayCastCompositeGOHelper::GenerateImage(), vtkMRMLVolumePropertyNode::GetColorTransferFunctionFromString(), vtkMRMLVolumePropertyNode::GetColorTransferFunctionString(), vtkMRMLArrayPlotNode::GetDrawObject(), vtkMRMLVolumePropertyNode::GetPiecewiseFunctionFromString(), vtkMRMLVolumePropertyNode::GetPiecewiseFunctionString(), MatrixRowCol::IncrDiag(), MatrixRowCol::IncrLT(), MatrixRowCol::IncrMat(), MatrixRowCol::IncrUT(), ipAllocateData(), mexFunction(), qMRMLNodeSelector::node(), vtkPETCTFusionPlots::OutputAllDataInCSV(), vtkPharmacokineticsIntensityCurves::OutputDataInCSV(), vtkPETCTFusionPlots::OutputDataInCSV(), PaddedImageBaseOf< DATA, 3 >::Pad(), SourceAccessorEqualizeBaseOf< DATA, 2, PRECISION, SOURCE >::PrepareForAccessAction(), PrintImage(), vtkUDPServerGUI::ProcessTimerEvents(), vtkFetchMIResourceUploadWidget::ProcessWidgetEvents(), vtkSlicerMRMLSaveDataWidget::ProcessWidgetEvents(), vtkHyperStreamlineTeem::ProduceFiberContext(), qCTKTestApplication::qCTKTestApplication(), vtkTeemEstimateDiffusionTensor::SetGradientsToContext(), SourceAccessorRangeScaleBaseOf< DATA, 2, PRECISION, SOURCE >::SetMinMaxRangeScale(), SourceAccessorRangeScaleBaseOf< DATA, 2, PRECISION, SOURCE >::SetNormalRangeScale(), sort_ascending(), sort_descending(), and itk::EncodedTransformFileReader::Update().

delimiterIndices = strfind(strList,' ')
in case of a tensor volume there are dimensions
else dwiGradient = extractGradient( cs(length('DWMRI_GRADIENT_')+1:end ) )
fidr = fileparts( nhdrFileName ) fopen( nhdrFileName, 'r' )
return else fk
Initial value:
 foundKeyword( keyWord, cs )

csU = upper( cs )
Initial value:
 extractGradient( st )

% first get the gradient number

iGNr = str2num( st(1:4) )
default header
end clear headerInfo
Initial value:
 loadNrrdStructure( nhdrFileName )

% reads all the header information from a nrrd file
% assumes a nhdr
end iEnd = len
for iI
Initial value:
1:lenThicknesses
      iThicknesses = [iThicknesses, str2num( sThicknesses{iI} ) ]

Referenced by DoIt().

iLocation = strfind( csU(length('SPACE:')+1:end ), 'RIGHT-ANTERIOR-SUPERIOR')
end indxList = []
end iNrs
Initial value:
 extractNumbersWithout( inputString, withoutTokens )

auxStr = inputString
iSD = extractNumbersWithout( space_dir_tmp, {'(',')',','} )
iStart = 1
keyWordU = upper( keyWord )
Initial value:
 [{'3D-masked-symmetric-matrix'} 
% {'space'} {'space'} {'space'}]
else kvs
Initial value:
 extractKeyValueString( st )

assgnLoc = strfind( st, ':=' )
len = length( strList )
lenKeyword = length( keyWord )
lenThicknesses = length( sThicknesses )
decided that the none is not needed in matlab
function otherwise it will not work makes Assumes nrrdStructure
Initial value:
 loadNrrdStructure( nhdrFileName )
%
% marc@bwh.harvard.edu
% kquintus@bwh.harvard.edu

% make sure to add path for nrrdLoad in the teem library. 
% comes with Slicer3

Referenced by if().

these fields are optional
const const T2 &t2 return [inline]

Referenced by vtkEMSegmentNodeParametersStep::ClassWeightChangedCallback(), vtkKWMimxCreateBBFromRubberBandPickGroup::CreateBBFromRubberBandPickCallback(), vtkKWMimxCreateSurfaceFromContourGroup::CreateSurfaceFromContourTraceContourCallback(), vtkEMSegmentKWDynamicFrame::DefineCheckButton(), vtkEMSegmentKWDynamicFrame::DefineTextEntry(), vtkEMSegmentKWDynamicFrame::DefineTextLabel(), vtkEMSegmentKWDynamicFrame::DefineVolumeMenuButton(), vtkMRMLAnnotationControlPointsNode::DeleteControlPoint(), vtkMRMLAnnotationLinesNode::DeleteLine(), vtkKWMimxEditBBMeshSeedGroup::EditBBMeshSeedPickCellCallback(), vtkKWMimxAssignBoundaryConditionsGroup::ElementSetOutputApplyCallback(), vtkImageEMLocalClass::ExecuteData(), vtkImageEMAtlasClass::ExecuteData(), vtkImageSumOverVoxels::ExecuteData(), vtkMimxCreateElementSetWidgetFEMesh::ExtractElementsBelongingToAFace(), vtkKWMimxCreateBBFromBoundsGroup::ManualBoundCallback(), vtkKWMimxAssignBoundaryConditionsGroup::NodeSetOutputApplyCallback(), vtkMimxPatchSurfaceMesh::PolyDataExecute(), vtkEMSegmentParametersSetStep::SelectedParameterSetChangedCallback(), vtkMimxSelectPointsWidget::SelectPointsOnAFaceFunction(), qSlicerWidget::setMRMLScene(), vtkEMSegmentMRMLManager::SetTargetSelectedVolumeNthID(), vtkEMSegmentMRMLManager::SetTreeNodeDistributionLogCovarianceOffDiagonal(), vtkEMSegmentMRMLManager::SetTreeNodeDistributionLogCovarianceWithCorrection(), vtkKWMimxEditBBMeshSeedGroup::ShowMeshSeedCallback(), vtkSlicermiAnnotationModuleLogic::StartAddingFiducials(), vtkSlicermiAnnotationModuleLogic::StopAddingFiducials(), vtkEMSegmentKWLogic::UpdateIntensityDistributionAuto(), and vtkEMSegmentMRMLManager::UpdateIntensityDistributionFromSample().

parse sizes headerInfo sizes = '?^
end end sl
Initial value:
 extractStringList( strList )

strList = removeExcessDelimiters( strList, ' ' )

Referenced by vtkQueryAtlasGUI::BuildQueriesGUI().

decided that the none is not needed in it s nicer to have a matrix space_dir_tmp = strrep( cs(length('SPACE DIRECTIONS:')+1:end), 'none', 'NaN' )
if (length(iSD)~=9 & length(iSD)~=10) fprintf('Warning end headerInfo spacedirections = [NaN NaN NaN
if (length(iSO)~=3) % fprintf('Warning end headerInfo spaceorigin = [NaN NaN NaN]

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1