Skip to content

Commit

Permalink
temporarily reset master to bugfix branch for build infra reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
coalsont committed Oct 15, 2024
1 parent 601d995 commit 150de12
Show file tree
Hide file tree
Showing 132 changed files with 973 additions and 10,288 deletions.
7 changes: 0 additions & 7 deletions src/Algorithms/AlgorithmCiftiCreateDenseScalar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "CaretAssert.h"
#include "GiftiLabelTable.h"
#include "MetricFile.h"
#include "PaletteColorMapping.h"
#include "StructureEnum.h"
#include "VolumeFile.h"

Expand Down Expand Up @@ -168,7 +167,6 @@ AlgorithmCiftiCreateDenseScalar::AlgorithmCiftiCreateDenseScalar(ProgressObject*
myXML.setNumberOfDimensions(2);
myXML.setMap(CiftiXML::ALONG_COLUMN, denseMap);
int numMaps = -1;
//Always choose a dominant input, to try to copy palette settings from, even if we have a name list
const CaretMappableDataFile* nameFile = NULL;
if (leftData != NULL)
{
Expand Down Expand Up @@ -244,11 +242,6 @@ AlgorithmCiftiCreateDenseScalar::AlgorithmCiftiCreateDenseScalar(ProgressObject*
} else {
scalarMap.setMapName(i, nameFile->getMapName(i));//copy map names
}
const PaletteColorMapping* thisPalette = nameFile->getMapPaletteColorMapping(i);
if (thisPalette != NULL)
{
*(scalarMap.getMapPalette(i)) = *thisPalette;
}
}
myXML.setMap(CiftiXML::ALONG_ROW, scalarMap);
myCiftiOut->setCiftiXML(myXML);
Expand Down
10 changes: 0 additions & 10 deletions src/Algorithms/AlgorithmCiftiCreateDenseTimeseries.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "CiftiFile.h"
#include "GiftiLabelTable.h"
#include "MetricFile.h"
#include "PaletteColorMapping.h"
#include "StructureEnum.h"
#include "VolumeFile.h"

Expand Down Expand Up @@ -182,18 +181,15 @@ AlgorithmCiftiCreateDenseTimeseries::AlgorithmCiftiCreateDenseTimeseries(Progres
myXML.setNumberOfDimensions(2);
myXML.setMap(CiftiXML::ALONG_COLUMN, denseMap);
int numMaps = -1;
const PaletteColorMapping* myPalette = NULL;
if (leftData != NULL)
{
numMaps = leftData->getNumberOfMaps();
myPalette = leftData->getMapPaletteColorMapping(0);
}
if (rightData != NULL)
{
if (numMaps == -1)
{
numMaps = rightData->getNumberOfMaps();
myPalette = rightData->getMapPaletteColorMapping(0);
} else {
if (numMaps != rightData->getNumberOfMaps())
{
Expand All @@ -206,7 +202,6 @@ AlgorithmCiftiCreateDenseTimeseries::AlgorithmCiftiCreateDenseTimeseries(Progres
if (numMaps == -1)
{
numMaps = cerebData->getNumberOfMaps();
myPalette = cerebData->getMapPaletteColorMapping(0);
} else {
if (numMaps != cerebData->getNumberOfMaps())
{
Expand All @@ -219,7 +214,6 @@ AlgorithmCiftiCreateDenseTimeseries::AlgorithmCiftiCreateDenseTimeseries(Progres
if (numMaps == -1)
{
numMaps = myVol->getNumberOfMaps();
myPalette = myVol->getMapPaletteColorMapping(0);
} else {
if (numMaps != myVol->getNumberOfMaps())
{
Expand All @@ -237,10 +231,6 @@ AlgorithmCiftiCreateDenseTimeseries::AlgorithmCiftiCreateDenseTimeseries(Progres
seriesMap.setStep(timestep);
seriesMap.setLength(numMaps);
myXML.setMap(CiftiXML::ALONG_ROW, seriesMap);
if (myPalette != NULL)
{
*(myXML.getFilePalette()) = *myPalette;
}
myCiftiOut->setCiftiXML(myXML);
CaretArray<float> temprow(numMaps);
const CiftiBrainModelsMap& myDenseMap = myXML.getBrainModelsMap(CiftiXML::ALONG_COLUMN);
Expand Down
4 changes: 2 additions & 2 deletions src/Algorithms/AlgorithmCiftiSeparate.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ void AlgorithmCiftiSeparate::getCroppedVolSpace(const CiftiFile* ciftiIn, const
int64_t numVoxels = (int64_t)myMap.size();
if (numVoxels > 0)
{//make a voxel bounding box to minimize memory usage
int64_t extrema[6] = { myMap[0].m_ijk[0],
int extrema[6] = { myMap[0].m_ijk[0],
myMap[0].m_ijk[0],
myMap[0].m_ijk[1],
myMap[0].m_ijk[1],
Expand Down Expand Up @@ -699,7 +699,7 @@ void AlgorithmCiftiSeparate::getCroppedVolSpaceAll(const CiftiFile* ciftiIn, con
int64_t numVoxels = (int64_t)myMap.size();
if (numVoxels > 0)
{//make a voxel bounding box to minimize memory usage
int64_t extrema[6] = { myMap[0].m_ijk[0],
int extrema[6] = { myMap[0].m_ijk[0],
myMap[0].m_ijk[0],
myMap[0].m_ijk[1],
myMap[0].m_ijk[1],
Expand Down
20 changes: 6 additions & 14 deletions src/Algorithms/AlgorithmVolumeResample.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ OperationParameters* AlgorithmVolumeResample::getParameters()

ret->addVolumeOutputParameter(4, "volume-out", "the output volume");

OptionalParameter* backgroundOpt = ret->createOptionalParameter(8, "-background", "use a specified value for locations outside the FoV of the input image or warpfield(s)");
backgroundOpt->addDoubleParameter(1, "value", "the value to use (default 0)");

ParameterComponent* affineOpt = ret->createRepeatableParameter(5, "-affine", "add an affine transform");
affineOpt->addStringParameter(1, "affine", "the affine file to use");
OptionalParameter* flirtOpt = affineOpt->createOptionalParameter(2, "-flirt", "MUST be used if affine is a flirt affine");
Expand Down Expand Up @@ -94,12 +91,6 @@ void AlgorithmVolumeResample::useParameters(OperationParameters* myParams, Progr
auto& affInstances = myParams->getRepeatableParameterInstances(5);
auto& affSeriesInstances = myParams->getRepeatableParameterInstances(6);
auto& warpInstances = myParams->getRepeatableParameterInstances(7);
float backgroundVal = 0.0f;//the help info says zero, don't use the VolumeFile constant
OptionalParameter* backgroundOpt = myParams->getOptionalParameter(8);
if (backgroundOpt->m_present)
{
backgroundVal = backgroundOpt->getDouble(1);
}
VolumeSpace refSpace;
{
NiftiIO myIO;
Expand All @@ -115,7 +106,7 @@ void AlgorithmVolumeResample::useParameters(OperationParameters* myParams, Progr
} else if (methodStr == "ENCLOSING_VOXEL") {
myMethod = VolumeFile::ENCLOSING_VOXEL;
} else {
throw AlgorithmException("unrecognized interpolation method '" + methodStr + "'");
throw AlgorithmException("unrecognized interpolation method");
}
XfmStack myStack;
auto xfmOrder = myParams->getRepeatableOrder();//helper for some ugly code to resolve relative order of repeatable options
Expand Down Expand Up @@ -172,11 +163,11 @@ void AlgorithmVolumeResample::useParameters(OperationParameters* myParams, Progr
throw AlgorithmException("internal error, tell the developers what you just tried to do");
}
}
AlgorithmVolumeResample(myProgObj, inVol, myStack, refSpace, myMethod, outVol, backgroundVal);
AlgorithmVolumeResample(myProgObj, inVol, myStack, refSpace, myMethod, outVol);
}

AlgorithmVolumeResample::AlgorithmVolumeResample(ProgressObject* myProgObj, const VolumeFile* inVol, const XfmStack& myStack, const VolumeSpace refSpace,
const VolumeFile::InterpType& myMethod, VolumeFile* outVol, const float backgroundVal) : AbstractAlgorithm(myProgObj)
const VolumeFile::InterpType& myMethod, VolumeFile* outVol) : AbstractAlgorithm(myProgObj)
{
LevelProgress myProgress(myProgObj);
vector<int64_t> outDims = inVol->getOriginalDimensions();
Expand Down Expand Up @@ -224,9 +215,10 @@ AlgorithmVolumeResample::AlgorithmVolumeResample(ProgressObject* myProgObj, cons
Vector3D inCoord = myStack.xfmPoint(outCoord, b, &validCoord);//put it through the inverse transforms that are in reverse order
if (validCoord)
{
scratchFrame[outVol->getIndex(i, j, k)] = inVol->interpolateValue(inCoord, myMethod, NULL, b, c, backgroundVal);
float interpVal = inVol->interpolateValue(inCoord, myMethod, NULL, b, c);
scratchFrame[outVol->getIndex(i, j, k)] = interpVal;
} else {
scratchFrame[outVol->getIndex(i, j, k)] = backgroundVal;
scratchFrame[outVol->getIndex(i, j, k)] = VolumeFile::INVALID_INTERP_VALUE;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Algorithms/AlgorithmVolumeResample.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace caret {
static float getAlgorithmInternalWeight();
public:
AlgorithmVolumeResample(ProgressObject* myProgObj, const VolumeFile* inVol, const XfmStack& myStack, const VolumeSpace refSpace,
const VolumeFile::InterpType& myMethod, VolumeFile* outVol, float backgroundVal = 0.0f);
const VolumeFile::InterpType& myMethod, VolumeFile* outVol);
static OperationParameters* getParameters();
static void useParameters(OperationParameters* myParams, ProgressObject* myProgObj);
static AString getCommandSwitch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ OperationParameters* AlgorithmVolumeWarpfieldAffineRegression::getParameters()
AString("For all voxels in the warpfield, do a regression that predicts the post-warp coordinate from the source coordinate. ") +
"When -roi is specified, only consider voxels with a value greater than 0 in <roi-vol>.\n\n" +
"The default is to expect the warpfield to be in relative world coordinates (mm space), and to write the output as a world affine (mm space to mm space). " +
"If you are using FSL-created files and utilities, specify -fnirt and -flirt-out as needed, as their coordinate conventions are different."
"If you are using FSL-created files and utilities, specify -fnirt and -flirt as needed, as their coordinate conventions are different."
);
return ret;
}
Expand Down
3 changes: 0 additions & 3 deletions src/Annotations/Annotation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,6 @@ Annotation::initializeAnnotationMembers()
&m_colorLine);
m_sceneAssistant->addArray("m_customColorLine", m_customColorLine, 4, 0.0);

m_sceneAssistant->add("m_lineWidthPercentage",
&m_lineWidthPercentage);

m_sceneAssistant->add("m_stackingOrder",
&m_stackingOrder);
}
Expand Down
16 changes: 0 additions & 16 deletions src/Brain/BrainOpenGLAnnotationDrawingFixedPipeline.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,6 @@ BrainOpenGLAnnotationDrawingFixedPipeline::drawAnnotationsInternal(const Drawing
/*
* Annotation being drawn by the user.
*/
Annotation* temporaryBoxAnnotation(NULL);
m_brainOpenGLFixedPipeline->checkForOpenGLError(NULL,
"Start of annotation drawn by user model space.");
if (m_annotationBeingDrawn != NULL) {
Expand All @@ -1296,7 +1295,6 @@ BrainOpenGLAnnotationDrawingFixedPipeline::drawAnnotationsInternal(const Drawing
AnnotationBox box(AnnotationAttributesDefaultTypeEnum::NORMAL);
box.applyCoordinatesSizeAndRotationFromOther(textAnn);
box.applyColoringFromOther(textAnn);
temporaryBoxAnnotation = &box;

drawAnnotation(m_dummyAnnotationFile,
&box,
Expand Down Expand Up @@ -1397,20 +1395,6 @@ BrainOpenGLAnnotationDrawingFixedPipeline::drawAnnotationsInternal(const Drawing
selectFlag = false;
}
}

/*
* When drawing a new text annotation by dragging the mouse to
* select a region, a box annotation is drawn (above) to show
* the region for the text. We DO NOT want to allow selection
* of this box because it will block selection of the text
* annotation and, since the box annotation is drawn on the
* stack (above), selection of the box will cause a crash.
*/
if (temporaryBoxAnnotation != NULL) {
if (selectionInfo.m_annotation == temporaryBoxAnnotation) {
selectFlag = false;
}
}
if (selectFlag) {
annotationID->setAnnotation(selectionInfo.m_annotationFile,
selectionInfo.m_annotation,
Expand Down
34 changes: 9 additions & 25 deletions src/Brain/BrainOpenGLFixedPipeline.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
#include "SurfaceProjectionBarycentric.h"
#include "SurfaceProjectionVanEssen.h"
#include "SurfaceSelectionModel.h"
#include "TabDrawingInfo.h"
#include "TopologyHelper.h"
#include "VolumeFile.h"
#include "VolumeMappableInterface.h"
Expand Down Expand Up @@ -1611,10 +1610,10 @@ BrainOpenGLFixedPipeline::drawTabAnnotations(const BrainOpenGLViewportContent* t
case ModelTypeEnum::MODEL_TYPE_CHART:
case ModelTypeEnum::MODEL_TYPE_CHART_TWO:
case ModelTypeEnum::MODEL_TYPE_INVALID:
case ModelTypeEnum::MODEL_TYPE_HISTOLOGY:
case ModelTypeEnum::MODEL_TYPE_MULTI_MEDIA:
drawScaleBarsFlag = false;
break;
case ModelTypeEnum::MODEL_TYPE_HISTOLOGY:
case ModelTypeEnum::MODEL_TYPE_SURFACE:
case ModelTypeEnum::MODEL_TYPE_SURFACE_MONTAGE:
case ModelTypeEnum::MODEL_TYPE_VOLUME_SLICES:
Expand Down Expand Up @@ -4585,7 +4584,6 @@ BrainOpenGLFixedPipeline::setupVolumeDrawInfo(BrowserTabContent* browserTabConte
{
volumeDrawInfoOut.clear();

const int32_t tabIndex(browserTabContent->getTabNumber());
OverlaySet* overlaySet = browserTabContent->getOverlaySet();
const int32_t numberOfOverlays = overlaySet->getNumberOfDisplayedOverlays();
for (int32_t iOver = (numberOfOverlays - 1); iOver >= 0; iOver--) {
Expand Down Expand Up @@ -4646,7 +4644,6 @@ BrainOpenGLFixedPipeline::setupVolumeDrawInfo(BrowserTabContent* browserTabConte
statistics,
wholeBrainVoxelDrawingMode,
mapIndex,
tabIndex,
opacity);
volumeDrawInfoOut.push_back(vdi);
}
Expand All @@ -4665,7 +4662,6 @@ BrainOpenGLFixedPipeline::setupVolumeDrawInfo(BrowserTabContent* browserTabConte
NULL,
wholeBrainVoxelDrawingMode,
mapIndex,
tabIndex,
opacity);
volumeDrawInfoOut.push_back(vdi);
}
Expand Down Expand Up @@ -4873,7 +4869,6 @@ BrainOpenGLFixedPipeline::drawVolumeVoxelsAsCubesWholeBrain(std::vector<VolumeDr

const DisplayPropertiesLabels* dsl = m_brain->getDisplayPropertiesLabels();
const DisplayGroupEnum::Enum displayGroup = dsl->getDisplayGroupForTab(this->windowTabIndex);
const LabelViewModeEnum::Enum labelViewMode(dsl->getLabelViewModeForTab(this->windowTabIndex));

/*
* For identification, five items per voxel
Expand Down Expand Up @@ -4944,12 +4939,6 @@ BrainOpenGLFixedPipeline::drawVolumeVoxelsAsCubesWholeBrain(std::vector<VolumeDr
glDisable(GL_LIGHTING);
}

const TabDrawingInfo tabDrawingInfo(volInfo.mapFile,
volInfo.mapIndex,
displayGroup,
labelViewMode,
this->windowTabIndex);

uint8_t rgba[4];
for (int64_t iVoxel = 0; iVoxel < dimI; iVoxel++) {
for (int64_t jVoxel = 0; jVoxel < dimJ; jVoxel++) {
Expand All @@ -4960,15 +4949,17 @@ BrainOpenGLFixedPipeline::drawVolumeVoxelsAsCubesWholeBrain(std::vector<VolumeDr
jVoxel,
kVoxel,
volInfo.mapIndex,
tabDrawingInfo,
displayGroup,
this->windowTabIndex,
rgba);
}
else {
volumeFile->getVoxelColorInMap(iVoxel,
jVoxel,
kVoxel,
volInfo.mapIndex,
tabDrawingInfo,
displayGroup,
this->windowTabIndex,
rgba);
}
if (rgba[3] > 0) {
Expand Down Expand Up @@ -5181,7 +5172,7 @@ BrainOpenGLFixedPipeline::drawVolumeVoxelsAsCubesWholeBrainOutsideFaces(std::vec

const DisplayPropertiesLabels* dsl = m_brain->getDisplayPropertiesLabels();
const DisplayGroupEnum::Enum displayGroup = dsl->getDisplayGroupForTab(this->windowTabIndex);
const LabelViewModeEnum::Enum labelViewMode(dsl->getLabelViewModeForTab(this->windowTabIndex));

/*
* For identification, five items per voxel
* 1) volume index
Expand Down Expand Up @@ -5325,12 +5316,6 @@ BrainOpenGLFixedPipeline::drawVolumeVoxelsAsCubesWholeBrainOutsideFaces(std::vec
std::vector<uint8_t> axialSliceRGBA(numAxialSizeRGBA);
std::vector<uint8_t> volumeRGBA(numRGBA, 0);

const TabDrawingInfo tabDrawingInfo(volInfo.mapFile,
volInfo.mapIndex,
displayGroup,
labelViewMode,
this->windowTabIndex);

/*
* Get coloring for all voxels in volume
*/
Expand All @@ -5341,7 +5326,8 @@ BrainOpenGLFixedPipeline::drawVolumeVoxelsAsCubesWholeBrainOutsideFaces(std::vec
volumeFile->getVoxelColorsForSliceInMap(volInfo.mapIndex,
VolumeSliceViewPlaneEnum::AXIAL,
kVoxel,
tabDrawingInfo,
displayGroup,
this->windowTabIndex,
axialSliceRGBA.data());
/*
* Apply layer opacity
Expand Down Expand Up @@ -9487,16 +9473,14 @@ BrainOpenGLFixedPipeline::VolumeDrawInfo::VolumeDrawInfo(CaretMappableDataFile*
const FastStatistics* statistics,
const WholeBrainVoxelDrawingMode::Enum wholeBrainVoxelDrawingMode,
const int32_t mapIndex,
const int32_t tabIndex,
const float opacity)
const float opacity)
: statistics(statistics) {
this->mapFile = mapFile;
this->volumeFile = volumeFile;
this->brain = brain;
this->paletteColorMapping = paletteColorMapping;
this->wholeBrainVoxelDrawingMode = wholeBrainVoxelDrawingMode;
this->mapIndex = mapIndex;
this->tabIndex = tabIndex;
this->opacity = opacity;
this->volumeType = SubvolumeAttributes::UNKNOWN;
if (this->volumeFile != NULL) {
Expand Down
2 changes: 0 additions & 2 deletions src/Brain/BrainOpenGLFixedPipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ namespace caret {
const FastStatistics* statistics,
const WholeBrainVoxelDrawingMode::Enum wholeBrainVoxelDrawingMode,
const int32_t mapIndex,
const int32_t tabIndex,
const float opacity);
Brain* brain;
CaretMappableDataFile* mapFile;
Expand All @@ -181,7 +180,6 @@ namespace caret {
WholeBrainVoxelDrawingMode::Enum wholeBrainVoxelDrawingMode;
const FastStatistics* statistics;
int32_t mapIndex;
int32_t tabIndex;
float opacity;
};

Expand Down
Loading

0 comments on commit 150de12

Please sign in to comment.