function obj = remove_candpivot( obj,idxcandpivot )

maskremove = false(1,size(obj.m_candpivots,2));
maskremove(idxcandpivot) = true;
maskretain = ~maskremove;

obj.m_candpivots = obj.m_candpivots(:,maskretain);
obj.m_lbs_per_candpivot = obj.m_lbs_per_candpivot(maskretain);
obj.m_candpivot2cxpts = obj.m_candpivot2cxpts(maskretain,:);
obj.m_matchscore_per_candpivot = obj.m_matchscore_per_candpivot(maskretain);
obj.m_segid_per_candpivot = obj.m_segid_per_candpivot(:,maskretain);

if ~isempty(obj.m_dftransmat_per_candpivot)
    obj.m_dftransmat_per_candpivot = obj.m_dftransmat_per_candpivot(maskretain);
end

if ~isempty(obj.m_candpivot2cxpts_fullcover)
    obj.m_candpivot2cxpts_fullcover = obj.m_candpivot2cxpts_fullcover(maskretain,:);
end

if ~isempty(obj.m_cxcubes_per_candpivot_label)
    obj.m_cxcubes_per_candpivot_label = obj.m_cxcubes_per_candpivot_label(maskretain);
end

if ~isempty(obj.m_cxcubes_per_candpivot_ldir)
    obj.m_cxcubes_per_candpivot_ldir = obj.m_cxcubes_per_candpivot_ldir(maskretain);
end

if ~isempty(obj.m_cxscore_per_candpivot_label)
    obj.m_cxscore_per_candpivot_label = obj.m_cxscore_per_candpivot_label(maskretain);
end

if ~isempty(obj.m_cxscore_per_candpivot_ldir)
    obj.m_cxscore_per_candpivot_ldir = obj.m_cxscore_per_candpivot_ldir(maskretain);
end

if ~isempty(obj.m_symask_candpivot2candpivot)
    obj.m_symask_candpivot2candpivot = obj.m_symask_candpivot2candpivot(maskretain,maskretain);
end

end

