void SoundMapInfo::LoadSoundMapInfo() {
	int i;
	int j;
	std::string Temps;

	//MAPFILE = vb6::App().Path + MapPath + "MAPA";

	/* 'Usage of Val() prevents errors when dats are corrputed or incomplete. All invalid values are assumed to be zero. */

	/* 'TODO : Log the error in the dat for correction. */
	for (i = (1); i <= (vb6::UBound(p_Mapas)); i++) {
		std::string datfile = GetMapPath(i, MAPPATH::DAT);
		Temps = GetVar(datfile, "SONIDOS", "Cantidad");

		if (vb6::IsNumeric(Temps)) {
			p_Mapas[i].Cantidad = vb6::Constrain(vb6::CInt(Temps), 0, MAX_SONIDOS);

			p_Mapas[i].flags.resize(0);
			p_Mapas[i].flags.resize(1 + p_Mapas[i].Cantidad);
			p_Mapas[i].Probabilidad.resize(0);
			p_Mapas[i].Probabilidad.resize(1 + p_Mapas[i].Cantidad);
			p_Mapas[i].SoundIndex.resize(0);
			p_Mapas[i].SoundIndex.resize(1 + p_Mapas[i].Cantidad);

			for (j = (1); j <= (p_Mapas[i].Cantidad); j++) {
				p_Mapas[i].flags[j] = vb6::val(GetVar(datfile, "SONIDO" + std::to_string(j), "Flags"));
				p_Mapas[i].Probabilidad[j] = vb6::val(
						GetVar(datfile, "SONIDO" + vb6::CStr(j), "Probabilidad"));
				p_Mapas[i].SoundIndex[j] = vb6::val(GetVar(datfile, "SONIDO" + std::to_string(j), "Sonido"));
			}
		} else {
			p_Mapas[i].Cantidad = 0;
		}
	}
}
int main(int argc, char **argv) {
	InitVars(argc, argv);
	if (argc != 2) {
		DLOG << "Usage: sweep_lines FRAME_ID";
		exit(-1);
	}

	string sequence = "lab_kitchen1";
	int frame_id = atoi(argv[1]);

	Map map;
	proto::TruthedMap gt_map;
	string path = GetMapPath(sequence);
	LoadXmlMapWithGroundTruth(path, map, gt_map);

	Frame* f = map.GetFrameByIdOrDie(frame_id);
	DLOG << "Loading image...";
	f->LoadImage();
	DLOG << "Loaded image.";

	GuidedLineDetector line_detector;
	line_detector.Compute(f->image);

	IsctGeomLabeller sweeper;
	sweeper.Compute(f->image, line_detector.detections);

	sweeper.OutputOrientViz("out/orients.png");

	return 0;
}