@Override
  public boolean processAlgorithm() throws GeoAlgorithmExecutionException {

    int i;
    AnalysisExtent ge;

    final int iMethod = m_Parameters.getParameterValueAsInt(METHOD);
    m_Bands = m_Parameters.getParameterValueAsArrayList(INPUT);

    if (m_Bands.size() == 0) {
      return false;
    }

    m_Classes = new HashMap();

    getClassInformation();

    if (m_Task.isCanceled()) {
      return false;
    }

    m_Output =
        getNewRasterLayer(
            CLASSIFICATION,
            Sextante.getText("Classification"),
            IRasterLayer.RASTER_DATA_TYPE_SHORT);
    m_Output.setNoDataValue(-1);
    ge = m_Output.getWindowGridExtent();

    m_Window = new IRasterLayer[m_Bands.size()];
    m_iBands = new int[m_Bands.size()];
    for (i = 0; i < m_Window.length; i++) {
      final RasterLayerAndBand band = (RasterLayerAndBand) m_Bands.get(i);
      m_iBands[i] = band.getBand();
      m_Window[i] = band.getRasterLayer();
      m_Window[i].setWindowExtent(ge);
    }

    switch (iMethod) {
      case 0:
        doParalellpiped();
      case 1:
      default:
        doMinimumDistance();
      case 2:
        doMaximumLikelihood();
    }

    return !m_Task.isCanceled();
  }