Hi Yang, > > nrOfVoxelsInMask->SetInput(filterBM->GetOutput()); > > std::cout<<"Number of Voxel"<<": " << nrOfVoxelsInMask->GetSum()<<std::endl; > It looks like you forgot to call nrOfVoxelsInMask->Update(); here. Regards, Matt