Thanks for the example.
Honestly, I am kind of distressed. I do exactly the same. The image is of cause
centered, but when extracting coordinates of the image center or the edges
than it simple does not fit to what I get in the fft-module.
when reading the data point from selection, could there be some wrong usage?
after creating the fft image exactly as you did in the example code, I read the
coordinates as follows:
void cb_selection_finished(GwySelection *selection, display_t *ctrls)
{
gdouble pos[2];
g_assert( gwy_selection_get_object(selection, ID, pos) );
printf("FFT corrd #%d.: [%g,%g]\n",ID,pos[0],pos[1]) ; // when clicking
the image center it pos[0] and pos[1] != 0
}
void cb_selection_changed(GwySelection *selection, gint id, display_t *ctrls)
{
ID = id ;
}
ID is global
could it be that the GwySelection is not well-connected to the data field?
selection[1] = (GwySelection*)
g_object_new(g_type_from_name("GwySelectionPoint"), NULL);
gwy_container_set_object_by_name(data[1], "/0/selection", selection[1]);
g_object_set(selection[1], "max-objects", 10, NULL);
vector_layer[1] = (GwyVectorLayer*)
g_object_new(g_type_from_name("GwyLayerPoint"), NULL);
gwy_vector_layer_set_selection_key(vector_layer[1], "/0/selection");
gwy_data_view_set_top_layer(data_view[1], vector_layer[1]);
Thanks for helping me and thanks for spending that much time with my problem.
Best,
/M
On 0, "David Nečas (Yeti)" <[email protected]> wrote:
> On Tue, Sep 16, 2014 at 08:51:12AM +0200, Mathias Müller wrote:
> >
> > I tried so, but it still doesn't show up with an image center at (0,0). The
> > same data shows a center at (0,0) in the fft module.
> >
> > thats how I fetch real data and generate the fft data and display them:
> >
> >
> > [code]
> > gwy_app_data_browser_get_current(GWY_APP_DATA_FIELD, &data_field, 0);
> >
> > data_field_fft_r = gwy_data_field_new_alike(data_field, FALSE);
> > gwy_data_field_2dfft(data_field,NULL,data_field_fft_r,data_field_fft_i,GWY_WINDOWING_NONE,GWY_TRANSFORM_DIRECTION_FORWARD,GWY_INTERPOLATION_ROUND,TRUE,1)
> > ;
> > gwy_data_field_fft_postprocess(data_field_fft_r,TRUE) ;
> > gwy_data_field_data_changed(data_field_fft_r);
> >
> > data[1] = gwy_container_new();
> > data_view[1] = GWY_DATA_VIEW(gwy_data_view_new(data[1]));
> > gwy_data_view_set_data_prefix(data_view[1], "/0/data");
> > gwy_container_set_boolean_by_name(data[1], "/0/data/realsquare", TRUE);
> > gwy_container_set_int32_by_name(data[1], "/0/base/range-type",
> > GWY_LAYER_BASIC_RANGE_FIXED);
> > gdouble min, max ;
> > gwy_data_field_get_min_max (data_field_fft_r,&min,&max);
> > gwy_container_set_double_by_name(data[1], "/0/base/min", 0.1*max);
> > gwy_container_set_double_by_name(data[1], "/0/base/max", 0.2*max);
> >
> >
> > g_assert( widget = GTK_WIDGET(gtk_builder_get_object(builder, "viewport2"))
> > );
> > gtk_container_add(GTK_CONTAINER(widget), GTK_WIDGET(data_view[1]));
> > [/code]
>
> I attach compilable module that shows the 0,0 frequency origin in the
> centre for me. I have no idea what you may be doing differently.
>
> Regards,
>
> Yeti
>
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Gwyddion-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gwyddion-users