typedef itk::SmartPointer<Self> Pointer;
itkNewMacro(Self);
- typedef typename std::map<int, clitk::DicomRT_ROI::Pointer>::iterator ROIIteratorType;
- typedef typename std::map<int, clitk::DicomRT_ROI::Pointer>::const_iterator ROIConstIteratorType;
+ typedef std::map<int, clitk::DicomRT_ROI::Pointer>::iterator ROIIteratorType;
+ typedef std::map<int, clitk::DicomRT_ROI::Pointer>::const_iterator ROIConstIteratorType;
void Print(std::ostream & os = std::cout) const;
void Read(const std::string & filename);
#ifndef _clitkVectorBSplineDecompositionImageFilter_txx
#define _clitkVectorBSplineDecompositionImageFilter_txx
#include "clitkVectorBSplineDecompositionImageFilter.h"
+#include "clitkDD.h"
#include "itkImageRegionConstIteratorWithIndex.h"
#include "itkImageRegionIterator.h"
#include "itkProgressReporter.h"
//void SetOutputSpacing(const SpacingType & s);
//void SetInputImageIsCoefficient(bool inputIsCoef) { mInputIsCoef = inputIsCoef; }
+ /** Evaluate the function at a ContinuousIndex position.
+ Overwritten for taking LUT into account (RP: multi-threading-compatible version,
+ the threadID is actually ignored) */
+ virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType & index, unsigned int /* threadID */ ) const
+ {
+ std::cout << "EvaluateAtContinuousIndex" << std::endl;
+ return this->EvaluateAtContinuousIndex( index );
+ }
+
/** Evaluate the function at a ContinuousIndex position.
Overwritten for taking LUT into account */
virtual OutputType EvaluateAtContinuousIndex(const ContinuousIndexType & index ) const;
VectorBSplineInterpolateImageFunctionWithLUT<TImageType,TCoordRep,TCoefficientType>::
EvaluateAtContinuousIndex(const ContinuousIndexType & x) const
{
-
// JV Compute BSpline weights if not up to date! Problem const: pass image as last
// if (!mWeightsAreUpToDate) UpdatePrecomputedWeights();
// For shorter coding
registration_elastix $reference_out $target_out $mask_ref_out $mask_targ_out $vf_out $result_out $params $log_out
fi
- # combine in and out vf
motion_mask=$mask_dir/mm_$phase_nb.mhd
+
+ # combine in and out results
+ out_result=$output_dir/result_${ref_phase_nb}_$phase_nb.mhd
+ clitkCombineImage -i $result_in -j $result_out -m $motion_mask -o $out_result
+ abort_on_error registration $? clean_up_registration
+
+ # combine in and out vf
vf_result=$vf_dir/vf_${ref_phase_nb}_$phase_nb.mhd
clitkCombineImage -i $vf_in -j $vf_out -m $motion_mask -o $vf_result
abort_on_error registration $? clean_up_registration
# create 4D vf
create_mhd_4D_pattern.sh $vf_dir/vf_${ref_phase_nb}_
+ # create 4D result image
+ create_mhd_4D_pattern.sh $output_dir/result_inside_${ref_phase_nb}_
+ create_mhd_4D_pattern.sh $output_dir/result_${ref_phase_nb}_
+
echo
echo "-------- Registration done ! --------"
end=`date`
# extract_bones
extract_lungs
# remove_tmp_masks 1
- resample
+ if [ $resample_spacing -ne 0 ] ; then
+ resample
+ fi
}
mm_postprocessing()
motion_mask()
{
#set cmd line variables
- mhd4d=$1
- resample_spacing=$2
- resample_algo=$3
+ mhd4d=`basename $1`
+ if [ $# -eq 3 ] ; then
+ resample_spacing=$2
+ resample_algo=$3
+ else
+ resample_spacing=0
+ resample_algo=0
+ fi
dir=`dirname $1`
cd $dir
fi
#set other global variables
- mask_dir="MASK-${resample_spacing}mm-$resample_algo"
+ if [ $resample_spacing -ne 0 ] ; then
+ mask_dir="MASK-${resample_spacing}mm-$resample_algo"
+ else
+ mask_dir="MASK"
+ fi
mask_dir_tmp="tmp.$mask_dir"
extract_4d_phases $mhd4d
# main #
#################
-if [ $# != 3 ]; then
- echo "Usage: $0 CT_4D RESAMPLE_SPACING RESAMPLE_ALGORITHM"
+if [ $# -ne 3 -a $# -ne 1 ]; then
+ echo "Usage: $0 CT_4D [RESAMPLE_SPACING RESAMPLE_ALGORITHM]"
exit -1
fi
#
if [ $1 != "using-as-lib" ]; then
- motion_mask $1 $2 $3
+ if [ $# -eq 3 ] ; then
+ motion_mask $1 $2 $3
+ else
+ motion_mask $1
+ fi
fi
int n_image_loaded=0;
std::string win(""), lev("");
+ bool link_images = false;
if (argc >1) {
for (int i = 1; i < argc; i++) {
std::string current = argv[i];
parse_mode=P_WINDOW;
} else if (current == "--level") {
parse_mode=P_LEVEL;
- } else if (current == "--log") {
+ } else if (current == "--linkall") {
+ link_images = true;
+ }
+ else if (current == "--log") {
std::string log_dir = QDir::tempPath().toStdString() + std::string("/vv-log");
if(itksys::SystemTools::FileExists(log_dir.c_str()) &&
window.ApplyWindowLevelToAllImages();
}
+ if (link_images)
+ window.LinkAllImages();
int ret = app.exec();
//------------------------------------------------------------------------------
void vvMainWindow::ApplyWindowLevelToAllImages()
{
+ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+ if(index==-1) return;
+ double window = mSlicerManagers[index]->GetColorWindow();
+ double level = mSlicerManagers[index]->GetColorLevel();
+
for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
if (mSlicerManagers[i] == NULL)
continue;
- mSlicerManagers[i]->SetColorWindow(windowSpinBox->value());
- mSlicerManagers[i]->SetColorLevel(levelSpinBox->value());
+ mSlicerManagers[i]->SetColorWindow(window);
+ mSlicerManagers[i]->SetColorLevel(level);
mSlicerManagers[i]->SetPreset(6);
mSlicerManagers[i]->Render();
}
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvMainWindow::LinkAllImages()
+{
+ linkPanel->linkAll();
+}
+
//------------------------------------------------------------------------------
void vvMainWindow::AddLink(QString image1,QString image2)
{
//------------------------------------------------------------------------------
void vvMainWindow::ChangeImageWithIndexOffset(vvSlicerManager *sm, int slicer, int offset)
{
+ if(mSlicerManagers.size()==1)
+ return;
+
int index = 0;
while(sm != mSlicerManagers[index])
index++;
- index = (index+offset) % mSlicerManagers.size();
+ index = (index+offset+mSlicerManagers.size()) % mSlicerManagers.size();
QTreeWidgetItem* item = GetItemFromSlicerManager(mSlicerManagers[index]);
item->setData(slicer+1,Qt::CheckStateRole,2); //change checkbox
"Images( *.png);;Images( *.jpg)");
// Loop on slices
- for(uint i=0; i<nbSlices; i++) {
+ for(int i=0; i<nbSlices; i++) {
// Change the slice
slicer->SetSlice(i); // -> change the slice of the current slicer
SM->UpdateSlice(0); // --> this one emit UpdateSlice
void ShowLastImage();
void SaveCurrentStateAs(const std::string& stateFile);
void ReadSavedStateFile(const std::string& stateFile);
+ void LinkAllImages();
virtual void UpdateCurrentSlicer();
virtual QTabWidget * GetTab();